赞
踩
使用第一个账号提交时,系统保存了该账号的用户信息。在使用新帐号提交时,与已保存的用户信息不一致,所以报错。
通用解决方案
进入库目录,找到 .git/confog 文件(macOS 可用终端执行 vi .git/config 直接进入修改),参考内容如下:
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
ignorecase = true
precomposeunicode = true
[remote "origin"]
url = https://github.com/userName/repositorieName.git
fetch = +refs/heads/*:refs/remotes/origin/*
[branch "other"]
remote = origin
merge = refs/heads/other
将用户名加入 [remote "origin"] 中的 url,最终修改为 url = https://userName@github.com/userName/repositorieName.git,接下来在提交项目时会要求输入密码。此后,系统将保存密码信息,以后这个库的提交将不再要求输入密码,也不会出现 403 错误。
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。