Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git cherry picking to a different base directory

I have certain commits in a branch, 10.57, which I want to merge to another branch 10.58.

I would normally cherry-pick those commits from 10.57 to 10.58.

There is however a glitch. Certain files have changed their directory structure in 10.58.

Example: The source dir MAAS/ios-web-services in 10.57 has moved to MAAS/apple/ios-web-services in 10.58.

If I cherry pick as before my changes would created afresh as new files/directories in MAAS/ios-web-services instead of getting merged to files in MAAS/apple/ios-web-services.

Is there a way I can ask git to factor in this change in directory structure?

Git cherry pick files, from Directory A to Directory B seems to suggest editing patches and applying them manually. Is there no other easier way?

like image 463
Abhijith Madhav Avatar asked Nov 21 '16 14:11

Abhijith Madhav


1 Answers

If the files only have minor changes you can try using merge.renameLimit as described for merging branches here: How to merge two branches with different directory hierarchies in git?

like image 144
nimatt Avatar answered Oct 19 '22 07:10

nimatt