Git Cherry-Pick and Conflicts

De openkb
Aller à : Navigation, rechercher

Sommaire

Questions

There are two different git branches. In one the development is going in (Branch1).

In other branch some PoC work is going on (Branch2). Now, I want to cherry-pick the changes from Branch1 to Branch2, so that Branch2 is up to date.

Now, after cherry-picking 4 or 5 changes, I am getting some merge conflict and I am unable to proceed with further cherry-picks.

Do, I need to resolve all the conflicts before proceeding to next cherry -pick or Can I somehow postpone the conflict resolution till I cherry-pick all the changes (and resolve all conflicts together)?

Further, is it suggested to do cherry-pick or branch merge in this case?

Answers

Do, I need to resolve all the conflicts before proceeding to next cherry -pick

Yes, at least with the standard git setup. You cannot cherry-pick while there are conflicts.

Furthermore, in general conflicts get harder to resolve the more you have, so it s generally better to resolve them one by one.

http://stackoverflow.com/questions/1670970/how-to-cherry-pick-multiple-commits http://stackoverflow.com/questions/1670970/how-to-cherry-pick-multiple-commits

Further, is it suggested to do cherry-pick or branch merge in this case?

Generally, if you want to keep a feature branch up to date with main development, you just merge master -> feature branch. The main advantage is that a later merge feature branch -> master will be much less painful.

Cherry-picking is only useful if you must exclude some changes in master from your feature branch. Still, this will be painful so I d try to avoid it.

Source

License : cc by-sa 3.0

http://stackoverflow.com/questions/19830464/git-cherry-pick-and-conflicts

Related

Outils personnels
Espaces de noms

Variantes
Actions
Navigation
Outils