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.
-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.
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.
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 .
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With