Is there a way to use Winmerge inside of git to do Diffs?
相关问题
- Why does recursive submodule update from github fa
- Extended message for commit via Visual Studio Code
- Emacs shell: save commit message
- Can I organize Git submodules in a flat hierarchy?
- Upload file > 25 MB on Github
相关文章
- 请教Git如何克隆本地库?
- GitHub:Enterprise post-receive hook
- Git Clone Fails: Server Certificate Verification F
- SSIS solution on GIT?
- Is there a version control system abstraction for
- ssh: Could not resolve hostname git: Name or servi
- Cannot commit changes with gitextensions
- git: retry if http request failed
I was confused about why the solution was presented as a DOS batch file, as my Git installation came with a bash shell. I was also unable to get a DOS context running from bash, so I've attempted to adapt what was previously shared in a bash context.
Since
git diff
appears to run the specified command once for each file, I split my solution into two bash scripts:First, configure
gitprepdiff.sh
to be the difftool as previously mentionedI also noted that the results of the
git configure
commands can be found and edited directly inC:\Users\<username>\.gitconfigure
gitdiff.sh
is then run at the command-line where you would normally callgit diff
Also worth noting is that, on my installation,
/tmp
(in bash) mapped to%LOCALAPPDATA%\Temp\1\
(in Windows), so that's why I'm using the latter in my call to WinMerge.As per the WinMerge command line manual: "Parameters are prefixed with either a forward slash ( / ) or dash ( - ) character"
Without configuration:
Assuming:
I faced trouble using the first part in 2 places and fixed it as follows
The second command for setting up winmerge.cmd required an extra slash on cmdline (before $LOCAL and $REMOTE), else cygwin was substituting the variable in cmdline
changed the winmerge.sh file to (without this, was getting right-path-invalid error)
Since the thread is getting confusing and bifurcated, here are consolidated instructions for the Directory Listing "--dir-diff" WinMerge method for msysgit Git Windows.
Step 1 - Create a file named winmerge.sh at a location accessible to your path (such as /home/bin/winmerge.sh) with following contents.
Step 2 - Type the following commands in Git Bash to instruct git to use winmerge.sh as difftool (these options get stored in /home/.gitconfig):
Step 3 - Now you can test by typing the following command in Git Bash to start your WinMerge diff:
Step 4 - For quicker access, create an alias for this command by adding this line to .bashrc in your home folder (or create .bashrc file with this line if file does not already exist):
Step 5 - Now you can quickly see a diff in WinMerge just by typing the following command into Git Bash
On windows you can do it this way:
1) Open .gitconfig file. It's located at your home directory: c:\users\username.gitconfig
2) Add the lines below. Pay attention to the single quotes wrapping the path to winmerge: