2012-12-12 40 views
3

是否有git-mergetool的標誌,其行爲如同--followgit-loggit mergetool --follow?

--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」。

+0

請不要編輯問題以完全更改它。而是提出一個新問題。在整個變更之前,我已經把它回滾到了這個版本。 – qqx

回答

1

git mergetool本身不執行合併,只有幫助清理由於已經進行的合併而導致的衝突。因此,將該選項應用於mergetool命令沒有任何意義。

對於git merge這個選項也沒有意義。合併將始終考慮文件移動。 --follow選項僅用於git log命令來覆蓋不同的行爲。正如您所引用的位表明該選項僅適用於獲取單個文件的日誌時,在這種情況下,您表示您只對該特定文件感興趣。 --follow選項可用於指示您還需要有關該文件以前名稱的信息。

+0

不會'mergetool'收集基本文件,本地文件和遠程文件?在這種情況下,我問它實際上是收集這三個而不是說遠程文件在本地移動時已被刪除。 – Jayen

+0

編號'merge'將不同的版本放入索引中。 – qqx

+0

我編輯了這個問題,以便更清楚地瞭解我想要的內容。它與如何存儲不同版本無關,只是存在。 – Jayen

相關問題