【发布时间】:2020-12-01 06:04:22
【问题描述】:
我的分支dev_match_test 是分支origin/dev 的更新。
我想将 dev_match_test 分支的本地更改发送到远程存储库,
这样将dev_match_test 合并到dev 的合并请求可以在以后获得批准。
git status 命令告诉我们:
On branch dev_match_test
Your branch is ahead of 'origin/dev' by 22 commits.
(use "git push" to publish your local commits)
但git push 返回错误:
fatal: The upstream branch of your current branch does not match
the name of your current branch. To push to the upstream branch
on the remote, use
git push origin HEAD:dev
To push to the branch of the same name on the remote, use
git push origin dev_match_test
尝试两个建议的选项都没有好处:
git push origin HEAD:dev
返回错误
remote: GitLab: You are not allowed to push code to protected branches on this project.
我怀疑这是因为我试图将更改推送到dev,但我没有这样做的权限。相反,我想推送到dev_match_test。
git push origin dev_match_test
只返回一条消息Everything up-to-date,什么都不做。
问题:如何将本地更改推送到dev_match_test 分支?
【问题讨论】: