轉: git使用時讓http記住帳號密碼
阿新 • • 發佈:2017-11-12
bsp 帳號 sch 小時 一次 help 如果 而且 remote
見 http://git.mydoc.io/?t=154710
https 方式每次都要輸入密碼,按照如下設置即可輸入一次就不用再手輸入密碼的困擾而且又享受 https 帶來的極速
按照以下設置記住密碼十五分鐘:
git config --global credential.helper cache
如果你想自定義記住的時間,可以這樣:
git config credential.helper ‘cache --timeout=3600‘ //這裏記住的是一個小時,如需其他時間,請修改3600為你想修改的時間,單位是秒
你也可以設置長期記住密碼:
git config --global credential.helper store
或修改倉庫的地址帶上你的賬號密碼
http://yourname:password@git.oschina.net/name/project.git //註意,碼雲平臺同時支持個性地址與郵箱,當使用郵箱時,請對@符號使用%40替換
如果你原本使用的 ssh 地址想更換成 http(s) 地址,可以執行以下命令:
//刪除原本的ssh倉庫地址
git remote rm origin //origin 代表你原本ssh地址的倉庫的別名
//新增http地址的倉庫
git remote add origin http://git.oschina.net/username/project.git
轉: git使用時讓http記住帳號密碼