run git pull without asking for a password

Asked

Viewed 13,078 times

5

I wonder if there’s a possibility that I can cache my password for my git user so that I’m not prompted for the password every time I perform a git pull from the server, remembering that I’m not allowed to change the server settings

//Updating

I use command line via linux shell and I’m not using git hub git server is installed on a server and always asks for password at pull

Goal I have a Shell Script that updates 5 projects at once but it asks 5 times the msma password would like to pass something by parameter such as git pull origin master --nopassword or git pull origin master --password 12345

  • Are you using a common terminal or some app? In the terminal you usually only need to enter the password once per session.

  • You use the repository on github?

  • updated the information

  • see if expect/send te resolve: http://stackoverflow.com/a/16007759/1001109

2 answers

4


Has command to store password temporarily: git config credential.helper cache, or command to store the password permanently: git config credential.helper store. The first holds credentials in cache for 5 minutes (standard). The second guard permanently.

The difference between one and the other is the security risk: if you’re not the only one accessing the computer, maybe git config credential.helper cache be better, because your credentials will not be exposed to other machine users after you finish your edits.

Determine how credentials are stored: git config credential.helper storeor git config credential.helper cache.

Next time you make one git push, your credentials will be stored.

Sources: git-Credential-store, git-Credential-cache.

2

I remembered that I already had this problem and I found the solution here: https://stackoverflow.com/a/7773605/1001109

It may be because you have the wrong URL, using https or git instead of ssh:

The correct URL:

[email protected]/username/repo.git

Other common but that can generate this error:

https://github.com/username/repo.git
git://github.com/username/repo.git

Browser other questions tagged

You are not signed in. Login or sign up in order to post.