Stop User/Password Prompt When Pushing to GitHub
1 min read

Stop User/Password Prompt When Pushing to GitHub

Every time I committed and pushed something to GitHub, I got a prompt for my username and password. I got annoyed and found a fix.

You need to change your .git/config file from:

[remote "origin"]
  url = https://github.com/mike1e/first_app.git
  fetch = +refs/heads/*:refs/remotes/origin/*

to

[remote "origin"]
  url = [email protected]:mike1e/first_app.git
  fetch = +refs/heads/*:refs/remotes/origin/*

by entering this issuing this command in your Terminal while in the git project directory. Make sure to substitute the correct information.

git config remote.origin.url [email protected]:
  [your-username]/[your-project].git