Skip to content

Instantly share code, notes, and snippets.

@ankyhe
Last active August 29, 2015 13:58
Show Gist options
  • Save ankyhe/9988642 to your computer and use it in GitHub Desktop.
Save ankyhe/9988642 to your computer and use it in GitHub Desktop.
git tips
-- Diffmerge as Diff in OSX --
1. Download diffmerge (https://sourcegear.com/diffmerge/), I suggest donwload dmg file
2. Copy diffmerge/extra/diffmerge into /usr/local/bin
3. sudo vim /usr/local/bin/dmdiff, which content is as below:
#!/bin/sh
/usr/local/bin/diffmerge "$2" "$5" >& /dev/null
4. vim ~/.gitconfig:
[diff]
external = dmdiff
tool = diffmerge
[difftool]
prompt = false
[difftool "diffmerge"]
cmd = diffmerge $LOCAL $REMOTE >& /dev/null
-- Show all diff in one time --
1. git clone https://github.com/ankyhe/git-diffall.git
2. copy git-diffall into $(git --exec-path)
3. you could use git diffall
examples:
git diffall HEAD^1..HEAD
git diffall --staged
Q&A:
Because diffall need folder diff functionality, so please make sure your diff tool supports it. (p4merge doesn't support folder diff). I suggest use Diffmerge in OSX (or Beyond Compare)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment