我们如果没有为项目设置用户名密码,那么每次提交都会有提示账号和密码输入:
git config user.name "qianxiao"
cat config
windows 直接记事本打开即可
显示如下内容:
[core] repositoryformatversion = 0 filemode = false bare = false logallrefupdates = true symlinks = false ignorecase = true [remote "origin"] url = http://gitee.com/xxx/object.git fetch = +refs/heads/*:refs/remotes/origin/* [branch "room"] remote = origin merge = refs/heads/room [user] name = qianxiao
看到最后一行,成功为当前项目设置了git用户名
git config credential.helper store
[core] repositoryformatversion = 0 filemode = false bare = false logallrefupdates = true symlinks = false ignorecase = true [remote "origin"] url = http://gitee.com/xxx/object.git fetch = +refs/heads/*:refs/remotes/origin/* [branch "room"] remote = origin merge = refs/heads/room [user] name = qianxiao [credential] helper = store
看到最后一行新增如上helper;
原文:https://www.cnblogs.com/qianxiaoPro/p/15117313.html