我想接受所有远程(他们的)修改,而不需要任何手动解决冲突。 但是,如果没有自动解决方案,我仍会遇到冲突:
$ git merge -s recursive -X theirs local/master
CONFLICT (rename/delete): rcS.d/S08kmod deleted in HEAD and renamed in local/master. Version local/master of rcS.d/S08kmod left in tree.
Auto-merging php5/cli/conf.d/20-xdebug.ini
CONFLICT (add/add): Merge conflict in php5/cli/conf.d/20-xdebug.ini
Auto-merging apt/sources.list
CONFLICT (rename/rename): Rename "apache2/sites-available/default-ssl"->"apache2/sites-available/default-ssl.conf.conf" in branch "HEAD" rename "apache2/sites-available/default-ssl"->"apache2/sites-available/default-ssl.conf" in "local/master"
使用pull:
$ git pull local master
From ssh://192.168.1.101/etc
* branch master -> FETCH_HEAD
warning: Cannot merge binary files: console-setup/cached_UTF-8_del.kmap.gz (HEAD vs. ada82813d27e5bef846ee086d07a87a82cfbb020)
CONFLICT (rename/delete): rcS.d/S08kmod deleted in HEAD and renamed in ada82813d27e5bef846ee086d07a87a82cfbb020. Version ada82813d27e5bef846ee086d07a87a82cfbb020 of rcS.d/S08kmod left in tree.
CONFLICT (add/add): Merge conflict in php5/cli/conf.d/20-xdebug.ini
CONFLICT (rename/rename): Rename "apache2/sites-available/default-ssl"->"apache2/sites-available/default-ssl.conf.conf" in branch "HEAD" rename "apache2/sites-available/default-ssl"->"apache2/sites-available/default-ssl.conf" in "ada82813d27e5bef846ee086d07a87a82cfbb020"
我也尝试过:
git merge --allow-unrelated-histories --strategy-option theirs local/master
但同样的冲突。
在第一个例子中使用git v2.8.1。 在第二个例子之前升级到GIT v2.9.2。
我的用例: 我使用GIT(更确切地说是使用ETCKEEPER)跟踪/ etc中的Debian升级更改。现在升级完成一些更改后,我想接受Debian所做的所有更改。当然我相信Debian升级所做的更改,所以我想覆盖(合并)所有已完成的更改,而不进行任何交互。
知道如何自动解决修改冲突吗?