# Usage: git whatsnew <other_branch>
# Show commits that are in the current branch,
# but not in <other_branch>. Great for an
# instant changelog.
whatsnew = !sh -c 'git shortlog --format=\"%h %s\" $1..HEAD' -
# Usage: git omgwtfbbq
# abort/reset/clean/etc everything back to HEAD.
# DESTRUCTIVE! Handy if you get git into a
# really odd state, during a merge, though...
omgwtfbbq = !sh -c '~/.bin/git-omgwtfbbq'
# and in ~/.bin/git-omgwtfbbq
#!/bin/bash
# Get confirmation from user
read -p "This will erase any work done and reset to HEAD. Continue? [yN] " -n1
if [[ ! $REPLY =~ ^[Yy]$ ]]
then
exit 1
fi
echo ''
# Reset everything
git clean -f && (git rebase --abort || git reset --hard)
[edit: formatting]Also, my favourite aliases are "cherrypick" for "cherry-pick" and "merge-tool" for "mergetool"; why they couldn't standardize their hyphenation convention, I don't know. :/
Also git dt = git difftool
Default difftool set to http://www.kaleidoscopeapp.com/
EDIT: Forgot about the following: core.editor = mate -w alias.unstage = reset HEAD --
mate -w opens text mate (http://macromates.com/) in blocking mode.
This conflicts with normal 'diff', so I add 'di', plus I have 'changed'='git diff' and 'staged'='git diff --cached', so I don't need 'git diff' so often anyway.
Then I use .gitconfig for all the commands I wish git had, e.g. 'unstage = reset HEAD', 'amend = commit --amend', etc.
st = status -sb (more compact status. Can always use the full word "status" if I want the normal one, but I don't think I've done that once since I set the alias. Not original, I found it online somewhere)
dfc = diff --cached
dfw = diff --word-diff
msg = commit --allow-empty -m (http://ozmm.org/posts/git_msg.html)
I do like the push mode setting in newer git versions as well.