天天看点

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