list mirror (unofficial, one of many)
 help / color / mirror / code / Atom feed
From: "brian m. carlson" <>
To: Mark Florian <>
Subject: Re: `@` alias for `HEAD` not working in `git push -u origin @`
Date: Wed, 10 Jul 2019 23:39:37 +0000	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

[-- Attachment #1: Type: text/plain, Size: 1020 bytes --]

On 2019-07-10 at 05:06:08, Mark Florian wrote:
> 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?

This is a bug. If the destination side of a refspec is omitted, and the
source side resolves to a ref starting with "refs/heads/" or
"refs/tags/" (which I expect it does here), then that ref is used as the

I submitted a patch at [0], but it was decided not to pick it up. If
Junio and the list decide that it's wanted, I'm happy to resend or
revise and resend.

brian m. carlson: Houston, Texas, US

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 868 bytes --]

  reply	other threads:[~2019-07-10 23:39 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-10  5:06 Mark Florian
2019-07-10 23:39 ` brian m. carlson [this message]
2019-07-11  9:46   ` Johannes Schindelin
2019-07-11 14:48     ` brian m. carlson
2019-07-12 10:29       ` Johannes Schindelin
2019-07-31  5:58   ` Jeff King
2019-07-31 16:10     ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

  List information:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \
    --subject='Re: `@` alias for `HEAD` not working in `git push -u origin @`' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Code repositories for project(s) associated with this inbox:

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).