I am trying to script a git pull without having to enter a username and password. How would I go about doing this? The only functionality I will be using from git is “git pull”.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
How are you connecting to the remote git repository? If you are using an http/https endpoint, read this document, which includes information about storing your username and password in a
.netrcfile.You can also embed your username and password in your remote url.
A better choice, if you have the option, is to use
sshinstead (a remote accessed via ssh looks likeusername@somehost.com:/path/to/repo). You can then set up ssh key-based authentication, which does not require a username and password.