i'm working my_branch_1 using git 1.7.1, , i'm trying rebase master. have changes of own in directory_1.
when attempt:
git rebase master
from branch, large number of merge conflicts (over 200) files in directory_2. how these conflicts got there, have no idea. have no way of knowing how conflicts should corrected since in files i've never opened , don't know about.
ideally, i'd love able tell git: "hey git - if hit merge conflict in directory_2, take file master, don't ask me fixing it".
at point, i'd ok accepting master merge conflicts, of work has been new files. how automatically tell git rebase , resolve conflicts using files master?
what can do git merge master
. generate merge conflicts. can use little shell magic rest git diff --name-only --diff-filter=u
. command list files conflicts. can like
$ git merge master $ git diff --name-only --diff-filter=u | grep ^path/to/directory_2 | xargs -i% sh -c 'git checkout -f head -- % && git add %'
and may finish merging
or can other way
$ git diff --name-only --diff-filter=u | grep ^path/to/directory_2 | xargs -i sh -c 'git checkout -f master -- % && git add %'
the first ours
on directory directory_2
, , second theirs
on directory directory_2
.
what script unresolved conflicts, filters grep
ones in directory_2
in list, , uses xargs
run command git checkout -f <branch: either head or master> -- <file> && git add <file>
each file in list.
Comments
Post a Comment