What does the argument @{u} mean in Git?
GitGit 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.