Skip to content

Instantly share code, notes, and snippets.

@naddeoa
Created December 5, 2016 03:08
Show Gist options
  • Save naddeoa/18256a38310be617c2c5f22788b079b4 to your computer and use it in GitHub Desktop.
Save naddeoa/18256a38310be617c2c5f22788b079b4 to your computer and use it in GitHub Desktop.
Quick, pretty git diff in the browser from the command line
#!/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
@naddeoa
Copy link
Author

naddeoa commented Dec 5, 2016

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 like git 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment