csdn git code 不能git clone [email protected]:yefengxuelang/testcsdn.git

csdn git code 不能git clone [email protected]:yefengxuelang/testcsdn.git

因爲公司的端口顯示不能用了,

可以採用git clone https://code.csdn.net/yefengxuelang/testcsdn.git 

壞處就是不能直接git push了每次都有輸入用戶名我的(yefengxuelang) 和密碼(****),

我暫時沒發現好的辦法,(除了用自己的熱點)



追加

1.1 創建文件存儲GIT用戶名和密碼

在%HOME%目錄中,一般爲C:\users\Administrator,也可以是你自己創建的系統用戶名目錄,反正都在C:\users\中。文件名爲.git-credentials,由於在Window中不允許直接創建以"."開頭的文件,所以需要藉助git bash進行,打開git bash客戶端,進行%HOME%目錄,然後用touch創建文件 .git-credentials, 用vim編輯此文件,輸入內容格式:

touch .git-credentials

vim .git-credentials

https://{username}:{password}@github.com (如:https://yefengxuelang:[email protected]

1.2 添加Git Config 內容

進入git bash終端, 輸入如下命令:

git config --global credential.helper store

執行完後查看%HOME%目錄下的.gitconfig文件,會多了一項:

[credential]

    helper = store

重新開啓git bash會發現git push時不用再輸入用戶名和密碼

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