Zuriar
Zuriar

Reputation: 11774

Adding username and password default on Git

Is it possible to store a remote Git repo's user credentials on my local machine so I don't keep getting asked for them everytime I do a pull etc?

thanks

Upvotes: 0

Views: 242

Answers (1)

hek2mgl
hek2mgl

Reputation: 158230

You need to use ssh keys and the git protocol (over ssh) when cloning:

git clone [email protected]:user/repo.git

If you are using github as git server, you can follow this documentation which describes how to create and use ssh keys.

If you cloned the repo already using the https protocol, you can change the origin following these steps:

git remote remove origin
git remote add origin [email protected]:user/repo.git

Upvotes: 1

Related Questions