{"thread":{"id":"32178","subject":"cherry-pick and reset while merging","startedAt":"2012-11-23T19:00:39Z","lastAt":"2012-11-23T19:00:39Z","messageCount":1,"participants":["Tobias Reuleaux"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"203714","messageId":"50AFC7D7.8040202@ixsys.de","threadId":"32178","inReplyTo":null,"subject":"cherry-pick and reset while merging","fromName":"Tobias Reuleaux","fromEmail":"trx@ixsys.de","sentAt":"2012-11-23T19:00:39Z","receivedAt":"2012-11-23T19:00:39Z","isPatch":false,"sender":{"key":"trx@ixsys.de","avatar":null},"body":"Hello everyone,\n\nwe recently switched to git and so far it's doing a terriffic job.\nToday though, we had a problem that we couldn't figure until now.\n\nWe have a master, a develop and a refactor branch. Today we merged \nrefactor into develop, which dramatically changes some source files. I \nneeded to change only one line in master and develop afterwards.\n\nSo i changed it in develop and cherry picked it into master.\n\n  $ git cherry-pick a165eb8c7b4306f349a9754102315195a17208ab\n\nGot of course a conflict and also know that this was a bad idea. So i \ndecided to reset this to HEAD and do a checkout from my HEAD after.\n\n  $ git reset HEAD somefile\n  $ git checkout -- somefile\n\nAfter that i modified my line by hand in the file (so the original \nmodification from develop wasn't there), made a diff afterwards (which \nonly showed the modification of the one line) and committed my changes.\n\n  $ git diff somefile\n  $ git push\n\nIn the end the new file from develop was pushed to master, which isn't \nof course what i wanted.\n\nWhat did i do wrong? Why does git reset to the develop HEAD during the \nmerge? Why is the checkout of the file a version of the file before the \ncherry-picked commit? Why does my diff show only the one changed line?\n\nA lot of questions i know. I'm totally new to git so can someone please \nhelp me!\n\nThank you in advance!\n\nkind regards,\n\nTobias\n"}]}