git for windows (又名 msysgit)如何记住用户名和密码 建立存储用户名密码的文件 在home文件夹,通常是 C:\Documents and Settings\Administrator 下创建文件 .git-credentials (windows下不容许直接建立以.开头的文件,因此有一个小技巧:先建立一个文件名叫 )git-credentials 而后进入 git bash 使用命令: mv git-credentials .git-credentials 用记事本打开这文件输入,若是用户名中有@,那么使用%代替: https://{username}:{password}@github.com 好比: https://zhangsan:123456@github.com 保存 添加config项 在任意文件夹下右键进入 git bash 而后输入: git config --global credential.helper store 执行完后去查看 C:\Documents and Settings\Administrator\.gitconfig 这个文件,发现多了一项: [credential] helper = store 就成功了。 而后要重开 git bash 窗口,再提交就不用输入用户名密码