Files
cocoa-eh-hugo-theme/exampleSite/content/posts/use-at-instead-of-head.md
Nishanth Shanmugham d4353d39e9 Update example site
2015-10-31 16:20:28 -05:00

689 B

+++ date = "2015-08-25T17:09:14-05:00" draft = false title = "Use @ instead of HEAD" slug = 'use-at-instead-of-head'

+++

I recently discovered that from git version 1.8.5 onwards, @ can replace HEAD:

{{< highlight bash >}} $ git reset --hard @~2 $ git rebase -i @~10 $ git diff @~2..@~3 {{}}

And also in most scenarios HEAD can be left out completely, so you can say:

{{< highlight bash >}} $ git reset -- @{2} {{}}

instead of:

{{< highlight bash >}} $ git reset -- HEAD@{2} {{}}

It takes some getting used to, but it's definitely faster than typing HEAD.