問題產生背景
客戶端領導決定使用http方式拉取和push代碼,因此沒法使用以前的ssh方式作免密處理git
解決辦法
方法1:在.git目錄中有個config目錄,在路徑前配置下用戶名和密碼便可,以下所示:
[core]
repositoryformatversion = 0
filemode =
false
bare =
false
logallrefupdates =
true
symlinks =
false
ignorecase =
true
[remote
"origin"
]
url = http:
//
帳號:
'密碼'
@192.168.10.7:8090
/test/Django
.git
fetch = +refs
/heads/
*:refs
/remotes/origin/
*
[branch
"master"
]
remote = origin
merge = refs
/heads/master
|
方法2:設置對全部項目有效
git config --global credential.helper osxkeychain #第一次須要輸入密碼,之後都不須要了,bash