GitHub About

如果第一次push上去之前你沒有先設定你的ssh key,而是後來才在setting加上你的public key的話,當時用下面的指令時

git remote add origin git@github.com:userName/projectName.git
git push -u origin master

就不會問你要不要每次輸入密碼
因為你沒有認證的機制,所以你每次都要打密碼才能push

而當你後來自己設定好ssh key時,不想要每次都輸入密碼,
就需要使用 git remote set-url origin 指令 再一次指定origin

官方說明:

Change your remote’s URL from HTTPS to SSH with the git remote set-url command.

git remote set-url origin git@github.com:USERNAME/OTHERREPOSITORY.git

資料來源:https://help.github.com/articles/changing-a-remote-s-url/

A single golf clap? Or a long standing ovation?

By clapping more or less, you can signal to us which stories really stand out.