Reputation: 448
Is there any way to set server password with local git repository? when every time i push to serve it's ask me to provide password. i want to make it's automatic with one time config.
Upvotes: 1
Views: 925
Reputation: 548
git provides storage of the credential
$ git config credential.helper store
$ git push http://example.com/repo.git
Username: <type your username>
Password: <type your password>
[several days later]
$ git push http://example.com/repo.git
[your credentials are used automatically]
it basically does is store the credential in .git-credentials file
https://user:[email protected]
check these official docs: git credential store
and Credential Storage
Upvotes: 0
Reputation: 1324337
It depends on your URL (git remote -v
inside your local repository to show it)
~/.ssh/authorized_keys
file, and SSH falls back to that server account password.Upvotes: 2
Reputation: 405
Look at your .git/config
file.
The remote part will look like this:
[remote "origin"]
url = https://url.tld
Change it to
[remote "origin"]
url = git@url:/path/on/server
Then it will use SSH. You can copy your SSH Key to the server and never will be asked for a password again
Upvotes: 0