Skip to content

Instantly share code, notes, and snippets.

@xxami
Last active August 29, 2015 14:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xxami/8db916b48a0bcd1aae27 to your computer and use it in GitHub Desktop.
Save xxami/8db916b48a0bcd1aae27 to your computer and use it in GitHub Desktop.
make git and hg remember user/passwords for github/bitbucket over https on linux ubuntu 14.10

plain-text

methods mentioned here are not secure as passwords must be stored in plain-text. for careless people only:

git on github

adding auth info to ~/.netrc works well (create if not exist)

machine github.com
login yourusername
password yourpassword

machine api.github.com
login yourusername
password yourpassword

make the file only readable/writeable from yourself (file owner)

chmod 600 ~/.netrc

hg on bitbucket.com

~/.hgrc works well (create if not exist)

[ui]
username = yourusername <your@e.mail>
editor = vim

[auth]
bb.prefix = https://bitbucket.org
bb.username = yourusername
bb.password = yourpassword

make the file only readable/writeable from yourself (file owner)

chmod 600 ~/.hgrc

note: the ui section is not needed it is just relevant. also bb is not a special name; it can be anything, and there can be more than one set of auth information for other domains and accounts (grouped under their own arbitrary name)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment