Administrator@changwei MINGW64 /d/github/git-study-test (master)
$ git push
Username for 'https://github.com': 867597730@qq.com
每次push的時(shí)候都讓我輸入一次github網(wǎng)站的帳號(hào)密碼,有什么辦法可以保存密碼或者登錄狀態(tài)?我之前已經(jīng)用keygen構(gòu)建了ssh并把公鑰提交到了github官網(wǎng)的ssh設(shè)置處,但是好像并沒有什么用啊。。。
@回憶時(shí)光 補(bǔ)充一下就是先查看一下你的推送地址是不是走的 ssh 協(xié)議
git remote -v
如果是 https 打頭的就要換,比如
https://github.com/laravel/laravel.git
要換成這個(gè)
git@github.com:laravel/laravel.git
執(zhí)行上面的步驟
git remote rm origin
git remote add origin git@github.com:laravel/laravel.git*
git pull
執(zhí)行git pull
的時(shí)候可能會(huì)提示git set-upstream....
什么的balabala 就是提示將本地分支和遠(yuǎn)程分支進(jìn)行綁定,按照提示操作就好
還有另一種辦法就是將遠(yuǎn)程的資源地址換成
git remote set-url origin https://<username>:<password>@github.com/<username>/<repo_name>.git
把賬號(hào)密碼寫到遠(yuǎn)程地址里
http://blog.justwe.site/2017/...
先刪除遠(yuǎn)程的倉庫
git remote rm origin
再添加遠(yuǎn)程倉庫,要用ssh協(xié)議的
git temote add origin ***
隱藏的.git目錄下設(shè)置config文件:
[credential]
helper = store