Managing Git Users and Passwords

I’ve been using Git to keep a repository of a project on a separate server. Currently to push things to the repository after a commit I do

git push

and then I am asked for the password for the account I used to setup the git repository on the remote server. Since it’s been awhile since I setup the repository, I’m not sure how to either remove that password (bad idea maybe) or change/add user accounts for the git repository. I’m sure it’s something simple but I’m having a hard time googling for it. Is there some argument I’m missing for the push command?

  • Can I restore my source code that has been uploaded into Google AppEngine?
  • How to extract all files of any commit to a folder/archive from a Git Repository?
  • How to find and backup your local GIT repository to be able to restore it later?
  • Incremental backups with git bundle, for all branches
  • Git and Dropbox - local repo
  • How to backup SVN repository?
  • Thanks.

  • Git cherry pick a commit and place it below
  • Possible to purge all git data before a specific commit?
  • Find the most recent commits where two files were identical
  • How do you fully revert to HTTPS after setting up SSH for Git?
  • Changes not staged after git add
  • How can I completely empty the master branch in Git?
  • One Solution collect form web for “Managing Git Users and Passwords”

    There’s likely some duplicates here on SO, but I didn’t see them at first search, so here’s your quick answer.

    You probably want to use SSH public/private keypair authentication. In general, this means running ssh-keygen on your local computer (if you haven’t before), and then using ssh-copy-id user@host to copy your public key to the remote. (If you don’t have ssh-copy-id, you can just add your public key to .ssh/authorized_keys on the remote; that’s all it does.) Be sure to give the public key to the appropriate user (the one with permissions for the git repo).

    If you’d like to be more secure, you can give your keypair a passphrase and use something like ssh-agent or keychain to remember it for a session. See Configuring Git over SSH for more information on that.

    If you’re going to be doing a lot of this, you might want to look into gitolite, which automates a lot of this git admin type stuff. If you’re going to keep doing it manually, and give others the ability to use that repo, you might want to make the repo user’s shell git-shell, which is essentially a no-login shell which is only able to run the necessary git commands.

    Git Baby is a git and github fan, let's start git clone.