天天看點

github | git push 每次都需要輸入使用者名和密碼

說明使用的是https方式送出代碼,如果是ssh方式,隻需要ssh key就可以。

方法一:

git config --global credential.helper store      

隻需要輸入一次使用者名和密碼,後面記住自動填充

git remove rm origin
git remote add origin [email protected]:$username$/$repository_name$
git push -u origin master

# if you don't have the permission
ssh-keygen -t rsa -C 'username'

# id_rsa.pub is stored in .ssh