I usually need to show someone a simple patch from a local git repo, my method was to run git format-patch and upload the result to my gnome.org userdir with a script conveniently called internets. This of course filled my userdir with garbage in the long run and also was a multiple step process.
So today, after a quick apt-cache search, I installed pastebinit, but then my problem was that there is no glue between this tool and git. Some googling took me to mentions of git-porcelains but I didn’t want to install that so I tried something simpler, a git alias.
I crafted this line for .gitconfig:
pastebinit = !sh -c 'git format-patch -1 –stdout $1 | pastebinit -f diff' -
Update: Ray and Pablo shared some ideas in the comments, the alias is updated, thanks!.
That I can use like this:
git pastebinit [commit]
It runs and outputs the url of my new pastebin’d code :-). I’m happy with it, but open to suggestions. Hope it’s useful for someone.