* cherry-pick and reset while merging
@ 2012-11-23 19:00 Tobias Reuleaux
0 siblings, 0 replies; only message in thread
From: Tobias Reuleaux @ 2012-11-23 19:00 UTC (permalink / raw)
To: git
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2012-11-23 19:11 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-23 19:00 cherry-pick and reset while merging Tobias Reuleaux
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.