First, this assume you use fugitive.vim. You don't? I really think you should. If you're still not convinced, have a quick look at the readme, take some time to go over one of the screencast linked there. I personally understood a lot about git index by watching the screencast Working with the git index.
I personnally like to have a look at my patches before giving them to my colleagues, there are a lot of options available to achieve this:
As you may have guessed, my favorite is the last one, for this, I use a small function plus a bind:
fu! GitReview() Glog --reverse origin/master.. -- . copen endf command Greview call GitReview() nnoremap <leader>gr :Greview<CR>
This creates the GitReview() function, allows you to call it via :Greview or by the bind
It will do a fugitive :Glog from the head of your current branch to origin/master and show it in reverse order so you start on the first commit after origin/master. This could be improved to do it based on the remotely tracked branch or accept a parameter to specify which branch to start from.
Once you called this, the first patch will be opened, likely with each files touched by the patch folded so you can review them one by one if you want. Following patches are loaded in the quickfixlist, that will likely have opened at the bottom of your vim. If you are not familiar with the quickfix list you can always :h quickfix. Thing to know, you can move forward and backward in this list be it shown or hidden, with :cn and :cp (Next/Prev).
And that's about it for this one. Hope it can be useful to someone!
Recently beorn shared two git typos on IRC, and I felt it was worth a small post about possible typos and their possible meaning, if any.
For when you need to get some?
Ok, this one may be a little far-fetched... still, it il likely you're searching for a bug, aren't you?
That one is for when you know your code is really dirty. (you better cleanup before pushing)
At this stage, its time for a beer. Oh, yeah!
Maybe too much git duff, or you are just checking how far behing origin/master you are.
Will you take the red or the blue pill?
After some git duff you'll have to take a pish, that is how it goes.
Doh'! You are about to check how this commit looks like now that you've sober up, not feeling good about it, eh?
Just having a look at the greatness of what you're actually building, that was worth the efforts!
Better keep an eye on your tab at Moe's, and make sure Barney hasn't been ordering on your tab.
That's about it, looking at a keyboard, other commands didn't gave me any idea, some are already quite far-fetched and may not have ended up in here, but here they are.