What does the argument @{u} mean in Git?

Git

Git Problem Overview


In the book "Git: Version Control for Everyone. Beginner's Guide" on page 69 there is a suggestion: "As an alternative to git pull, we can also use git fetch followed by git merge @{u}".

What does @{u} mean here?

A search in Google for git merge @{u} provides a link to this page https://mislav.net/2013/02/merge-vs-rebase/ where @{u} can also be found.

Git Solutions


Solution 1 - Git

It is a shortcut to refer to the upstream branch which the current branch is tracking. So for instance if you're on branch topic/fix_blub which is tracking origin/topic/fix_blub then git merge @{u} does the same thing as git merge origin/topic/fix_blub.

@{u} is part of Git's mini-language for locating revisions, which is described in detail here.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionabgView Question on Stackoverflow
Solution 1 - GitPeterView Answer on Stackoverflow