On 07/16/2014 05:08 PM, Niall Douglas wrote:
On 16 Jul 2014 at 9:32, Eric Niebler wrote:
I recently made a tweak to the .gitignore of the super-project on the develop branch. How do I merge that to master? The two branches have different histories, so a regular git merge balks. And when I checkout master (thinking I'll just cherry-pick), I end up with a slew of local changes (which I haven't made).
I think you check out the destination branch, then do
git checkout <src branch> <paths> git commit
He'll copy of all the necessary history for that file and merge it with the local history. Check the log to be sure. Push as normal after.
Why is that better than cherry-picking the commit? Seems likely to lose data, e.g. if there are other differences to the file on the two branches.