在windows上使用_netrc文件讓Git記住用戶名和密碼(Linux文件名爲.netrc)

場景

  1. 使用ssh由於網絡策略問題沒法訪問git@github.com
  2. 使用https做爲remote origin

缺點

明文存儲html

實現

  • 定義一個用戶環境變量%HOME%, 值爲%USERPROFILE%
  • 在%HOME%路徑下新建一個文件_netrc(Linux文件名爲.netrc)
  • 在_netrc文件中增長下面的配置
machine github.com
login github_user
password githu_password

 

FTP初始化文件.netrc使用技巧:git

http://www.360doc.com/content/15/0827/14/1106320_495171593.shtmlgithub

相關文章
相關標籤/搜索