Friday, 15 January 2010

git - Is it possible to do a partial merge with --ff-only changes? -



git - Is it possible to do a partial merge with --ff-only changes? -

i have local branch needs merged remote. both remote , local branches have lots of different commits (on various files). possible identify , merge files have fast-forward type (remote-side) changes? deal other changes manually. git merge --ff-only not merge when there two-sided changes.

edit: create question more clear. let's original files (on parent node) file1, file2, file3, file4. local branch, modified file1, file2, deleted file4, added file5. in remote branch, modified file1,file3, deleted file4, added file6. following:

identify changes info of made alter (with git diff): file1 (both sides) file2, file5 (my side) , file3 , file6 on side. merge specific one-sided changes (from side): after merge local remote, should have file3 , file6 modified in remote branch , file1,file2,file5 modified in local branch. deal file1 , file5 vs file6 manually.

git read-tree low-level merge prep, short of actual conflict resolution. 1 easy way is

git merge-s ours --no-commitother# no-op merge, sets parents git read-tree -um $(git merge-baseheadother) headother #manual resolution here git commit

which leaves different new content in both branches manual resolution accepts at-most-one-new-version files. might want read-tree's --aggressive option, handle whole-file deletion , add-on ordinary change.

as safety play unlikely case, check output of git merge-base--all headother. if shows multiple bases (as when recent merges on each branch have mutual parents), git's (default) "recursive" merge strategy have derived base of operations content produces improve automatic resolution results actual bases, , might want take care manual resolution.

git git-merge

No comments:

Post a Comment