在 `git rebase` 期间自动化 `--ours` 和 `--theirs`
Automate `--ours` and `--theirs` during `git rebase`
我有一个 500 次提交的长变基,我必须为每次提交指定相同的文件以通过 github checkout --ours file.py
和 --theirs
支持;有没有办法通过告诉 Git Bash 将此首选项应用于所有进一步的冲突来自动执行此操作?
如果这是一个草率的过程,那么请随意编写一个脚本...类似于:
git rebase blahblahblah
if [ $? -ne 0 ]; then
# rebase stopped for whatever reason
while true; do
git checkout --ours blahblah
# more commands to specify what should be attempted with each file
git add . # add all files.... perhaps something a little mlre specific would help
# let's try again
GIT_EDITOR=/bin/true git rebase --continue
if [ $? -eq 0 ]; then
break # we are done
fi
done
fi
我有一个 500 次提交的长变基,我必须为每次提交指定相同的文件以通过 github checkout --ours file.py
和 --theirs
支持;有没有办法通过告诉 Git Bash 将此首选项应用于所有进一步的冲突来自动执行此操作?
如果这是一个草率的过程,那么请随意编写一个脚本...类似于:
git rebase blahblahblah
if [ $? -ne 0 ]; then
# rebase stopped for whatever reason
while true; do
git checkout --ours blahblah
# more commands to specify what should be attempted with each file
git add . # add all files.... perhaps something a little mlre specific would help
# let's try again
GIT_EDITOR=/bin/true git rebase --continue
if [ $? -eq 0 ]; then
break # we are done
fi
done
fi