【发布时间】:2018-02-28 02:11:37
【问题描述】:
我将本地 develop 分支重置为后面的几个提交,并希望将本地 develop 分支推送到其远程,以便远程的 HEAD 现在也重置为后面的几个提交。
换句话说,我确实喜欢这样:
UserName path/ (develop)
$ git reset --hard {CommitIdOfAFewCommitsBehind}
Your branch is behind 'origin/develop' by 14 commits, and can be fast-forwarded.
(use "git pull" to update your local branch)
nothing to commit, working tree clean
$ git push origin develop
To https://github.devtools.merrillcorp.com/Javelin/wopi-poc.git
! [rejected] develop -> develop (non-fast-forward)
error: failed to push some refs to 'https://github/repo.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
如何让遥控器也转到我想要的提交 ID?
【问题讨论】:
标签: git