git rebase leaves the conflict markers inline in files; something like:
<<<<<<< HEAD
Whatever line + context is different from the previous commit
=======
Whatever line + context is different from the commit being applied
>>>>>>> new version, new branch:app/views/common/version.txt
When I use git apply to apply a patch created with git format-patch, it will fail to leave any files modified by default. I can give it --reject which will cause it to create .rej files for those that have unresolvable conflicts, but really, I want it to modify files and leave every in the state that git rebase does so I can just open the file, manually merge it, and then git add it and tell git apply to continue. Is there some way to do this that I just don't know of?
For me the following works:
git init
seq 1 30 > file
git add file
git commit -m 1-30
sed -i '13a13.4' file
git commit -m 'add 13.4' file
git format-patch -1
git reset --hard HEAD^
sed -i 13d file
git commit -m 'remove 13' file
git am -3 0001-add-13.4.patch
After that file
has conflict markers. That is use git am -3
instead of git apply
.