简体   繁体   中英

git cherry-pick causes branch ahead of origin/master

I'm trying to merge specific commits from a branch into master, and push them to origin.

Here is what I'm doing:

M4600 ~/git/plutext/docx4j (master)
$ git reset --hard origin/master
HEAD is now at 2b2d124 Image support in non-XSLT HTML export.

M4600 ~/git/plutext/docx4j (master)
$ git status
# On branch master
nothing to commit (working directory clean)

M4600 ~/git/plutext/docx4j (master)
$ git cherry-pick d89cc32b11d338c0874838a730f04f83c85021bd
[master cb6bf93] Make table output work again.
 1 files changed, 11 insertions(+), 11 deletions(-)

M4600 ~/git/plutext/docx4j (master)
$ git status
# On branch master
# Your branch is ahead of 'origin/master' by 1 commit.
#
nothing to commit (working directory clean)

Where am I going wrong?

Nothing going wrong at all.

You simply have applied a commit to your local master, so it now has 1 more than origin/master (the remote branch) so you just need to push it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM