原文地址:https://blog.csdn.net/sdoyuxuan/article/details/79077794
解决方法
1.在代码的.git/config文件内[remote “origin”]的url的gitlab域名前添加gitlab注册时的“用户名:密码@”
2.这个用户要在对应项目下的角色是Owner或Master才行,如果是Guest、Reporter、Developer,则如下操作后也是不行。
操作
[chengyuxuan@dmp01 ~/GitDown/K-V-]$ cat .git/config
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = https://用户名:密码@github.com/sdoyuxuan/K-V-.git
[branch "master"]
remote = origin
merge = refs/heads/master