Push Permissions



About

Instructions for automating pushes to github/bitbucket.


Methods

Git permissions are usually resolved via either

  • Ssh keys for git served repositories

  • Username/password for https served repositories

Used to use ssh keys when that was all that was available, but for everything https logins are much easier to manage.


Login Credentials for Https

These will always ask you for username/password on the command line when required (cloning, pushing).

Automating with .netrc

The constant username/password gets annoying, so automate it via your .netrc file. On linux this can be found at ~/.netrc. On windoze at@ C:\Users\UserName\_netrc. For each source, you need something like:


.netrc
machine github.com
login YOUR_GITHUB_USER_NAME
password YOUR_GITHUB_PASSWORD
 
machine bitbucket.org
login YOUR_BITBUCKET_USER_NAME
password YOUR_BITBUCKET_PASSWORD


Finally (for linux), make sure the permissions for that file are secure:

chmod 600 ~/.netrc