Created
December 5, 2016 03:08
-
-
Save naddeoa/18256a38310be617c2c5f22788b079b4 to your computer and use it in GitHub Desktop.
Quick, pretty git diff in the browser from the command line
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Make the column size whatever you want. 230 seemed reasonable in my testing. | |
# On Ubuntu, you can get these dependnecies with `sudo apt-get install ruby-bcat colordiff` | |
git difftool -y -x "colordiff -y -W 230" $1 | bcat |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If you put that on your path then you can run
git browser-diff
and it should pop your browser open with a two column, colored diff. If you want to send your most recent changes in a pretty email to someone then you would do something likegit browser-diff HEAD~..HEAD
and copy/paste the HTML.Comes in pretty handy at the workplace where people's attention is limited.
Remember:
sudo apt-get install ruby-bcat colordiff
for Ubuntu.