Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Send Git commit diffs into gist file

I'm aware of the major functions that gist and github can offer even not an in-depth control of all commands.
Now I need to maintain some historical changes inot my git repository and What I'm lookin for is, Is there any automatic way (command) to push the git changes in some branch as a .diff into a gist file? Let's say I want to send a pull request in a gist file.
Actually I can get the .diff of some commit and copy paste the content into by-hand created gist file.

Any recommandations would be greately appreciated.
BR.

like image 915
tmarwen Avatar asked Jan 31 '14 09:01

tmarwen


1 Answers

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

  1. Install the gist CLI client:

    gem install gist
    

    For OS X, you can install even from Homebrew:

    brew install gist
    
  2. Associate it with your account (it doesn’t store your credentials, it just uses them to get an OAuth2 token):

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

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

    and it will give you URL of the created gist.

like image 124
Jakub Jirutka Avatar answered Oct 04 '22 21:10

Jakub Jirutka