Create gists from Command Line

Installation

1. Install pretty-diff npm package

npm install -g pretty-diff

2. Add your github username into git global configuration

git config --global github.user "YourGitHubUsernameHere"

3. Create a Personal Access Token (don’t forget to check the “Create gist” checkbox) in order to pretty-diff to work. Once you have created the token, run this command

git config --global gist-diff.token "YourPersonalAccessTokenHere"

Now you’re ready to use gist-diff!

Creating a Gist

Now you can just run gist-diff command in order to create a gist with the content of git diff

gist-diff

When gist-diff has created the gist it will open the gist URL in your browser.