Git aliases inspired by GUM, a better UI for Git
by Vladimir Grichina
Some of the commands provided by Git are quite confusing and GUM project tries to address it.
However it looks like most useful stuff can also be achieved through use of Git aliases:
[alias]
stage = !sh -c '[[ -z "$@" ]] && git add -u || git add "$@" && git add -u "$@" ' -
unstage = reset HEAD --
rewind = ![[ -z "$@" ]] && git reset --hard HEAD || git checkout HEAD
These aliases provide such new commands:
git stage
– stages all changes to already tracked files (including deletions)git stage FILES
– stages changes to given files only (including deletions and additions of new files)git unstage
– removes everything from staging area (working copy remains unchanged)git unstage FILES
– removes given files from staging area (working copy remains unchanged)git rewind
– resets all changes done to the working copy (including staging area)git rewind FILES
– resets all changes done to the given files (including staging area)
Code available as Gist: https://gist.github.com/1707519