Send git commit diff to gist file

I know the basic functions that gist and github can offer not even in-depth control over all commands.
Now I need to save some historical inot changes in my git repository, and I'm looking for is there any automatic way (command) to push git changes to any branch like .diff in gist file? Say I want to send a pull request to a gist file.
In fact, I can get a .diff of some commit and copy the paste of the contents into the manually created gist file.

Any recommendations would be greatly appreciated.
BR.

+7
git github git-diff gist
source share
1 answer

You can use one of the gist CLI clients . I can recommend the first one written in Ruby.

  • Install the gist CLI client:

     gem install gist 

    For OS X, you can even install from Homebrew:

     brew install gist 
  • Associate it with your account (it does not store your credentials, it just uses them to get the OAuth2 token):

     gist --login 
  • Then you can simply create a gist from the command line, for example:

     git diff <commit>..<commit> | gist -f foo.diff 

    and it will give you the url of the created object.

+22
source share

All Articles