我正在使用带有xltrail 扩展名的 Git for Windows,以便在使用git diff <Excel workbook>
. 我还在使用Beyond Compare 4 Pro图形差异/合并工具,它在使用时运行git difftool
并提供了一个很好的并排差异和三向合并界面。
但是,当我运行时git difftool <Excel workbook>
,我得到正常git diff
输出,而没有提示打开 Beyond Compare。如何让 Git、xltrail 和 Beyond Compare 一起工作?
编辑#1
这是一个不起作用的完整示例:
$ git config diff.tool; git config difftool.bc.path; git config difftool.prompt
bc
c:/Program Files/Beyond Compare 4/bcomp.exe
false
$ cat .git/config
[core]
repositoryformatversion = 0
filemode = false
bare = false
logallrefupdates = true
symlinks = false
ignorecase = true
[diff "xltrail"]
command = git-xltrail-diff.exe
[merge "xltrail"]
name = xltrail merge driver for Excel workbooks
driver = git-xltrail-merge.exe %P %O %A %B
$ cat ~/.gitconfig
# This is Git's per-user configuration file.
[user]
name = Andrew Keeton
email = AKeeton@example.com
[push]
default = simple
[alias]
co = checkout
ci = commit
cam = commit -am
st = status
br = branch
# short log
shlog = log --pretty=format:\"%C(yellow bold)%h%Creset %ad %C(cyan)|%Creset %s%C(magenta)%d%Creset %C(bold)[%an]%Creset\" --date=short --name-only
hist = log --pretty=format:\"%C(yellow bold)%h%Creset %ad %C(cyan)|%Creset %s%C(magenta)%d%Creset %C(bold)[%an]%Creset\" --date=short --graph
[diff]
tool = bc
[difftool "bc"]
path = c:/Program Files/Beyond Compare 4/bcomp.exe
[difftool]
prompt = false
$ git st
On branch master
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: workbook.xlsm
modified: README.md
no changes added to commit (use "git add" and/or "git commit -a")
$ git diff README.md
diff --git a/README.md b/README.md
index a052e20..3fd700d 100644
--- a/README.md
+++ b/README.md
@@ -40,6 +40,11 @@
## Tips
+* Lorem ipsum dolor sit amet, consectetur adipiscing elit.
+* Curabitur a dui eu massa feugiat varius tempor eget tellus.
+* Nullam et fringilla eros.
+* Etiam euismod ipsum enim, non molestie nunc varius eu.
+
* In Excel, press `CTRL+G` to open the *Go To* window. This makes it easy to find the various tables and "anchors."
## xltrail
$ git difftool README.md
<See screenshot of README.md in Beyond Compare 4>
$ git diff workbook.xlsm
diff --xltrail a/workbook.xlsm b/workbook.xlsm
--- a/workbook.xlsm/VBA/Module/modWorksheet
+++ b/workbook.xlsm/VBA/Module/modWorksheet
@@ -14,6 +14,7 @@
Dim dDouble1 As Double
Dim dDouble2 As Double
Dim dDouble3 As Double
+ Dim sString1 As String
Dim dDouble4 As Double
Dim iInteger1 As Integer
$ git difftool workbook.xlsm
diff --xltrail a/workbook.xlsm b/workbook.xlsm
--- a/workbook.xlsm/VBA/Module/modWorksheet
+++ b/workbook.xlsm/VBA/Module/modWorksheet
@@ -14,6 +14,7 @@
Dim dDouble1 As Double
Dim dDouble2 As Double
Dim dDouble3 As Double
+ Dim sString1 As String
Dim dDouble4 As Double
Dim iInteger1 As Integer