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

說明使用的是https方式提交代碼,如果是ssh方式,只需要ssh key就可以。

方法一:

git config --global credential.helper store

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

方法二:

刪除https方式提交,使用ssh方式

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

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章