git gui免密碼

建立存儲用戶名密碼的文件

在home文件夾,通常是 C:\Documents and Settings\Administrator 下創建文件 .Git-config (windows下不容許直接建立以.開頭的文件,因此有一個小技巧:先建立一個文件名叫 )git-credentials 而後進入 git bash 使用命令:git

 

[plain]  view plain  copy
 
  1. mv git-config .git-config 


用記事本打開這文件輸入:github

 

 

[sql]  view plain  copy
 
  1. https://{username}:{password}@github.com  


好比:sql

 

 

[plain]  view plain  copy
 
  1. https://zhangsan:123456@github.com  

保存windows

 

添加config項

在任意文件夾下右鍵進入 git bashbash

而後輸入:spa

 

[plain]  view plain  copy
 
  1. git config --global credential.helper store  
 


執行完後去查看 C:\Documents and Settings\Administrator\.gitconfig 這個文件,發現多了一項:.net

 

 

[plain]  view plain  copy
 
  1. [credential]  
  2.     helper = store  


就成功了。blog

 

而後要重開 git bash 窗口,再提交就不用輸入用戶名密碼ip

相關文章
相關標籤/搜索