From: Tobias Reuleaux <trx@ixsys.de>
To: git@vger.kernel.org
Subject: cherry-pick and reset while merging
Date: Fri, 23 Nov 2012 20:00:39 +0100 [thread overview]
Message-ID: <50AFC7D7.8040202@ixsys.de> (raw)
Hello everyone,
we recently switched to git and so far it's doing a terriffic job.
Today though, we had a problem that we couldn't figure until now.
We have a master, a develop and a refactor branch. Today we merged
refactor into develop, which dramatically changes some source files. I
needed to change only one line in master and develop afterwards.
So i changed it in develop and cherry picked it into master.
$ git cherry-pick a165eb8c7b4306f349a9754102315195a17208ab
Got of course a conflict and also know that this was a bad idea. So i
decided to reset this to HEAD and do a checkout from my HEAD after.
$ git reset HEAD somefile
$ git checkout -- somefile
After that i modified my line by hand in the file (so the original
modification from develop wasn't there), made a diff afterwards (which
only showed the modification of the one line) and committed my changes.
$ git diff somefile
$ git push
In the end the new file from develop was pushed to master, which isn't
of course what i wanted.
What did i do wrong? Why does git reset to the develop HEAD during the
merge? Why is the checkout of the file a version of the file before the
cherry-picked commit? Why does my diff show only the one changed line?
A lot of questions i know. I'm totally new to git so can someone please
help me!
Thank you in advance!
kind regards,
Tobias
reply other threads:[~2012-11-23 19:11 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=50AFC7D7.8040202@ixsys.de \
--to=trx@ixsys.de \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.