Git交互式rebase - 任何指示git解决保持HEAD版本的冲突的方法?

时间:2016-06-11 13:40:12

标签: git git-rebase git-merge-conflict

尝试git rebase -i -Xours master $ git --version git version 2.6.1.windows.1 ,但仍显示冲突,我必须手动解决。此外,还不完全清楚在提交冲突的情况下非冲突变更会发生什么 - 是否保留了?

用例:临时修改master上的一些旧分支以查看这些分支中是否有任何此类更改(根本不在master中),但将代码版本保留为master以进行冲突更改(可怕的,可怕的冲突)

{{1}}

1 个答案:

答案 0 :(得分:1)

git ls-files -u | cut -f2- | uniq | git checkout-index --stdin --stage=all \
| while read base ours theirs path; do
        git merge-file --ours \
                -L "$path" -L o/"$path" -L b/"$path" \
                -- $ours $base $theirs
        mv $ours "$path"
        rm $base $theirs
done