我开始在主题分支上做一些工作
•-•-• < topic
/
•-• < master
我推送主题分支
$ git push origin topic
其他人将更改推送到 master
•-•-• < origin/topic
/
•-•-•—• < origin/master
如何更新我的本地 master 和 rebase 我的主题?
历史应该是这样的
•-•-• < topic
/
•-•-•—• < master
我正在尝试什么
; update master
$ git checkout master
$ git fetch origin
$ git merge --ff-only origin/master
; rebase topic
$ git checkout topic
$ git rebase master
问题
我所有的提交topic
都被视为未提交。所以当我尝试时git push origin topic
,我得到
! [rejected] topic -> topic (non-fast-forward)
error: failed to push some refs to '/path/to/repo.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Merge the remote changes (e.g. 'git pull')
hint: before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
解决方案?
请注意,我不想将我的topic
分支与master
. 我只想更新我的本地存储库,而不必不必要地合并分支。