Git aliases

OmarchymacOS

Global git aliases: a log I actually read, and one word to take back the last step.

The aliases

git lsThe log, one line per commit: hash, subject, author, refs.
git ld · git ldrThe same with the date, exact or relative.
git treegit ls as a graph.
git lastThe last commit, with the files it touched.
git amendAdds what is staged to the last commit, keeping its message.
git undoTakes the last commit back and keeps its changes.
git publishPushes the branch and sets its upstream.
git unpublishDeletes the branch on the remote.
git aliasesLists every alias.
git ln <name> <command>Defines a new global alias.

How it gets there

A script sets them with git config --global, so they live in ~/.gitconfig and work in any shell and any editor.

Files