所以我在研究Gitlab。同时假装是管理员和合作者。
作为行政:
myslavebranch“。作为合作者:
$ git init
$ git config --global user.name "theslave"
$ git config --global user.email "theslave@gmail.com"
$ git remote add origin git@gitlab.com:theadmin/masterproject.git
$ git pull
$ git clone git@gitlab.com:theadmin/masterproject.git是的,现在我把这个项目纳入我的回购计划。修改文件,添加,执行。现在转到分支
$ git checkout myslavebranch
$ git push我得到了:
remote:
remote: ========================================================================
remote:
remote: You are not allowed to push code to this project.
remote:
remote: ========================================================================
remote:
fatal: Could not read from remote repository.这里有什么问题?管理员需要先给予许可吗?是关于SSH吗?走错了一步?我想把我编辑的版本推到管理员创建的分支。我该怎么做呢?
发布于 2020-02-24 15:30:47
检查存储库的权限。
我认为您需要成为开发人员、维护人员或所有者来推动代码。类似的配置对于贡献者将代码推入存储库是必要的。例如,在大多数情况下,管理员应该将用户作为“开发人员”添加到存储库中,或者以更好的角色推送代码。或者管理员允许任何人推送代码。
参考资料:https://docs.gitlab.com/ee/user/permissions.html
其他疑难解答包括检查SSH公钥是否已在gitlab中正确注册并与您的帐户链接。
另外,请检查管理员创建的分支是否受到保护。
参考资料:https://docs.gitlab.com/ee/user/project/protected_branches.html
https://stackoverflow.com/questions/60378828
复制相似问题