Normally when I want to update my project from a remote repository I use the following command line.
git pull -a origin develop
I learned this from my project team members but I could not find the answer on the Internet what the -a flag does. What does the -a mean?
The git pull
command is essentially just a convenience shortcut.1 It first runs git fetch
, then it runs another Git command. The second Git command defaults to git merge
, but under various circumstances, you can make the second command be git rebase
.
This is all that git pull
does: It runs two other Git commands. All options and arguments to git pull
either control which second command it uses, or are passed on, usually directly, to one of the other commands.
In this case, -a
or --append
is passed on to git fetch
, which tells it to append all of the fetched references to the FETCH_HEAD
file (rather than replacing any existing FETCH_HEAD
file iwth fetched references). Unless you are using FETCH_HEAD
yourself, this option is useless.
1Since the best second command to run can depend on the result of the first command, as conveniences go, this one is really very inconvenient. It's like having to decide whether to walk, drive, or fly to a destination before you know whether it's in your neighborhood, in your city, or in another continent.
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