- 在home目錄下面創建.git-credentials文件
vi .git-credentials
編輯內容
http://username:[email protected]/name/project.git
- 設置記住密碼(默認15分鐘):
git config --global credential.helper cache
如果想自己設置時間,可以這樣做:
git config credential.helper 'cache --timeout=3600'
這樣就設置一個小時之後失效
長期存儲密碼:
git config --global credential.helper store
- 進入到~目錄查看文件
$cd ~
$cat .gitconfig
會看到
[credential]
helper = store
- 進入到git項目牡蠣
cd projectfile/
- 移除遠程ssh方式的倉庫地址
git remote rm origin
- 增加https遠程倉庫地址
git remote add origin http://username:[email protected]/name/project.git
git免密碼 pull push
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.