2

I know you can refer to the tip of the current branch in Git with the name HEAD.

Is there some sort of equivalent for referring to the tip of the remote tracking branch of the current branch?

Just so I don't have to type out remote/current-branch if there's something shorter.

ApplePieGiraffe
  • 155
  • 1
  • 8

1 Answers1

4

@{upstream} or just @{u}, with a branch name in front if you're not referring to your current checkout.

jthill
  • 55,082
  • 5
  • 77
  • 137
  • 1
    Would [`@{push}`](https://stackoverflow.com/a/36671530/6309) be of interest here? – VonC Feb 10 '22 at 08:17
  • Yes, in some settings, `@{push}` and `@{upstream}` might be set on different branches/remotes. (But I too use `@{u}` in most "normal" cases as a handy shortcut) – Romain Valeri Feb 10 '22 at 08:33
  • `@{U}` (capital U) also works. (For those who are too lazy to release and then repress the shift key. You know who you are.) – Justin Donnelly Jun 29 '22 at 11:44