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 窗口,再提交就不用輸入用戶名密碼