git 設置不須要輸入密碼

https方式每次都要輸入密碼,按照以下設置便可輸入一次就不用再手輸入密碼的困擾並且又享受https帶來的極速git

設置記住密碼(默認15分鐘):ssh

git config --global credential.helper cache

若是想本身設置時間,能夠這樣作:spa

git config credential.helper 'cache --timeout=3600'

這樣就設置一個小時以後失效.net

長期存儲密碼:code

git config --global credential.helper store

增長遠程地址的時候帶上密碼也是能夠的。(推薦)orm

http://yourname:password@git.oschina.net/name/project.git

補充:使用客戶端也能夠存儲密碼的。ci

若是你正在使用ssh並且想體驗https帶來的高速,那麼你能夠這樣作: 切換到項目目錄下 :rem

cd projectfile/

移除遠程ssh方式的倉庫地址it

git remote rm origin

增長https遠程倉庫地址import

git remote add origin http://yourname:password@git.oschina.net/name/project.git
相關文章
相關標籤/搜索