Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

git

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.

like image 855
abg Avatar asked Oct 20 '13 06:10

abg


People also ask

What does U mean in git push u?

-u : The -u flag creates a tracking reference for every branch that you successfully push onto the remote repository. The local branch you push is automatically linked with the remote branch. This allows you to use commands such as git pull without any arguments.

What is flag in git push origin master?

It's used to set origin as the upstream remote in your git config. It may help if you don't want to manually specify the remote every time you run git push.

What is upstream flag in git?

Basically, you use this flag when you want to set origin as the upstream remote for a branch. This is needed if you don't want to manually specify the remote every time you use git pull .

What does the flag do in git?

By using the -a flag when committing you are telling Git to add all files that have been modified and then commit them. This runs into issues with new files, though. Since the -a flag only adds modified files it will not add new files or deleted files.


1 Answers

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.

like image 121
Peter Avatar answered Oct 15 '22 15:10

Peter