git保存用户名和密码
在使用git时,每次从git bash 或者 vscode中pull或者push时都要输入用户名密码

解决方法:

windows

  1. 新建文件,文件名: _netrc
  2. 在文件中写入如下信息

    1
    2
    3
    machine github.com //将github.com替换为远程机器的域名地址 
    login usernmae //用户名
    password password //密码
  3. 将_netrc文件移动到 C:\Users\windows用户名 目录下

再次pull或者push就不用输入用户名和密码了


在window 10中一次输入后会自动存储

本文地址: http://gehaiqing.com/2016/11/06/git-store-userauth/