git mergetool - 关注?

时间:2012-12-12 22:52:50

标签: git merge git-merge git-log

git-mergetool的标记是否与--follow的行为类似git-log

   --follow
       Continue listing the history of a file beyond renames (works only
       for a single file).

基本上我希望它合并重命名的文件而不是认为它们被删除。

git-mergetool提供以下内容:

       When git mergetool is invoked with this tool (either through the -t
       or --tool option or the merge.tool configuration variable) the
       configured command line will be invoked with $BASE set to the name
       of a temporary file containing the common base for the merge, if
       available; $LOCAL set to the name of a temporary file containing
       the contents of the file on the current branch; $REMOTE set to the
       name of a temporary file containing the contents of the file to be
       merged, and $MERGED set to the name of the file to which the merge
       tool should write the result of the merge resolution.

所以我想要的是,在重命名/移动文件的情况下,BASE / LOCAL / REMOTE仍然可以工作。我希望git-mergetool根据需要“跟随”将BASE重命名为LOCAL或REMOTE。

1 个答案:

答案 0 :(得分:1)

git mergetool本身不会执行合并,只会帮助清除由于正在进行的合并而导致的冲突。因此,将该选项应用于mergetool命令是没有意义的。

git merge拥有该选项也没有意义。合并将始终考虑文件移动。仅--follow命令才需要git log选项来覆盖不同的行为。由于您引用的位表示该选项仅在获取单个文件的日志时适用,在这种情况下,您已表明您只对该特定文件感兴趣。 --follow选项可用于指示您还需要有关该文件的先前名称的信息。