Question

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.

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top