When I execute: git pull --rebase from my feature branch, I get conflicts in lot of files which I've never edited. To get rid of these conflicts I execute following set of commands for each and every conflicted files.
git checkout --ours .
git add .
git rebase --continue
The annoying part is I have to execute this for every conflicts. Is there any way to configure git with a custom command so that above all commands will execute at once.
Something like:
If(featureBranch_04) {
foreach(conflicts)
if(conflictedFile != index.jsp) {
git checkout --ours .
git add .
git rebase --continue
}
}
}
Can I have a similar function in git config ?
The workflow is: First I merged the master branch into featureBranch_04, and then git pull --rebase from the featureBranch_04 branch.
You could try a:
git fetch
git rebase -s recursive -X theirs origin/featureBranch_04
That would pass the merge strategy 'theirs' to the merge part of a rebase.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With