I'm using Git for Windows with the xltrail extension to provide a readable output when using git diff <Excel workbook>
. I'm also using the graphical diff/merge tool Beyond Compare 4 Pro which runs when using git difftool
and provides a nice side-by-side diff and three-way merge interface.
However, when I run git difftool <Excel workbook>
, I get the normal git diff
output without a prompt to open Beyond Compare. How can I get Git, xltrail, and Beyond Compare to work together?
Edit #1
Here's a complete example of this not working:
$ 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