I am trying to script some git operations which involves some rebasing/cherry-picking/etc.
Is there a way to resolve a conflict without having to run commands such as:
git rebase --continue
git cherry-pick --continue
git merge --continue
I am trying to avoid the editor ever being executed when git wants a commit message.
Perhaps there is a way to tell git that things have been resolved and pass in a default commit message if needed?
You can use git commit -m '$msg'
to commit the changes, then issue a command saying "keep going with the next steps" :
For git rebase
:
git commit -m '$msg'
git rebase --skip
For git cherry_pick
:
git commit -m '$msg'
# if you are cherry-picking several commits at once,
# this will skip the current (conflicting) one, and proceed with the remaining ones :
git reset
git cherry-pick --continue
For git merge
:
There is no git merge --continue
directive. In case of conflict you just fix the conflict, then commit
. So git commit -m '$msg'
will do it.
Try to use -x
option. Thats options does:
-x When recording the commit, append a line that says "(cherry picked from commit ...)" to the original commit message in order to indicate which commit this change was cherry-picked from. This is done only for cherry picks without conflicts. Do not use this option if you are cherry-picking from your private branch because the information is useless to the recipient. If on the other hand you are cherry-picking between two publicly visible branches (e.g. backporting a fix to a maintenance branch for an older release from a development branch), adding this information can be useful.
git-scm.herokuapp.com/docs/git-cherry-pick
Also --allow-empty
may be usefull
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