Why is that git pull
pulls everything including newly created remote branches but git pull origin master
does not?
I'm using git version 2.9.3.windows.2
.
About the default branch The default branch is also the initial branch that Git checks out locally when someone clones the repository. Unless you specify a different branch, the default branch in a repository is the base branch for new pull requests and code commits.
The git fetch command downloads commits, files, and refs from a remote repository into your local repo. Fetching is what you do when you want to see what everybody else has been working on.
Then " git pull " will fetch and replay the changes from the remote master branch since it diverged from the local master (i.e., E ) until its current commit ( C ) on top of master and record the result in a new commit along with the names of the two parent commits and a log message from the user describing the changes ...
git fetch is similar to pull but doesn't merge. i.e. it fetches remote updates ( refs and objects ) but your local stays the same (i.e. origin/master gets updated but master stays the same) .
In Layman Language, git pull
fetches everything from your remote (all new branches and updates old branches) and by default, it will do so for origin
. If you have any other remote like upstream
you have to specify that like git pull upstream
and it will update everything from upstream.
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