【发布时间】:2018-06-21 22:48:07
【问题描述】:
我有一个 repo,我想推送到 develop 分支。
我用过
$ git checkout develop
Already on 'develop'
Your branch is up-to-date with 'origin/develop'.
还完成了develop 分支的git pull。
我期待
$ git push
推送到开发分支。但事实并非如此。
djave at djave-comp in ~/projects/project on develop*
$ git push
Counting objects: 49, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (49/49), done.
Writing objects: 100% (49/49), 25.45 KiB | 0 bytes/s, done.
Total 49 (delta 38), reused 0 (delta 0)
To bitbucket.org:djave/project.git
f311657..16b42c7 develop -> develop
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to 'djave@bitbucket.org:djave/project.git'
hint: Updates were rejected because a pushed branch tip is behind its remote
hint: counterpart. Check out this branch and integrate the remote changes
hint: (e.g. 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
看起来它正在推送到develop:
f311657..16b42c7 develop -> develop
但随后也尝试推送到master 分支(并失败):
! [rejected] master -> master (non-fast-forward)
我希望它只是推送到develop 分支并成功。
如何让 git push 只推送到 develop 分支?
对不起,如果这是重复的(已广泛搜索但找不到正确的问题组合)或标题未使用正确的术语(请随时更新标题)
【问题讨论】:
-
@SurajRao 啊,是的——谢谢