git/list[1] front-page[2] threads[3] people[4] search[5] about
 

`@` alias for `HEAD` not working in `git push -u origin @`

From
MFMark Florian <mflorian@gitlab.com>
Date
Jul 10, 2019, 05:06 UTC
Message-ID
<CANC=f2c8eynWJ1r=zwZq1qwrDE85LVFMU2mjLU26HYMDGaD4iA@mail.gmail.com>
Hello!
I learned today that `@` is a shortcut for `HEAD`. From `git help reivisions`:
    @ alone is a shortcut for HEAD.
However, when I tried to use it in a command I frequently use, I got an error:
    $ git push -u origin @
    fatal: invalid refspec '@'
I'm running git version 2.22.0 on Linux.
Is this a bug, or have I misunderstood how this is supposed to work?

Cheers, Mark

Next: brian m. carlson
Message 1 of 7 in “`@` alias for `HEAD` not working in `git push -u origin @`”
  1. Mark FlorianJul 10, 2019
  2. brian m. carlsonJul 10, 2019
  3. Johannes SchindelinJul 11, 2019
  4. brian m. carlsonJul 11, 2019
  5. Johannes SchindelinJul 12, 2019
  6. Jeff KingJul 31, 2019
  7. Junio C HamanoJul 31, 2019

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.