TortoiseGit 连接oschina不用每次输入username和password的方法

每次git clone 和push 都要输入username和password。尽管安全。但在本机上每次都输有些麻烦,怎样记住username和password呢?

在网上看了各种方法,太杂,非常多可能环境不一样。一直行不通。最后找到一种有效的方法,非常easy。记录下来!


当你配置好git后,在C:Documents and SettingsAdministrator 文件夹下有一个  .gitconfig 的文件。里面会有你先前配好的name 和email,仅仅需在以下加一行

[credential]    
    helper = store 


下次再输入username 和password 时。git就会记住,从而在C:Documents and SettingsAdministrator 文件夹下形成一个  .git-credentials 文件,里面就是保存的你的username和password。

https://username:12345678@git.oschina.net


这样以后再连接git.oschina 代码库时,就不用再输入username和password了!

原文地址:https://www.cnblogs.com/gavanwanggw/p/6761797.html