Having no remote repository, just one local repository with two branches.
$ git branch -a master * devel
Are following commands in this context the same/synonym?
$ git pull . master
and
$ git merge master
UPDATE:
$ git help pull
gives following information
SYNOPSIS git pull <options> <repository> <refspec>... DESCRIPTION ... Note that you can use . (current directory) as the <repository> to pull from the local repository — this is useful when merging local branches into the current branch.
I actually don't understand why this is useful as mentioned in this manpage.
The git pull command first runs git fetch which downloads content from the specified remote repository. Then a git merge is executed to merge the remote content refs and heads into a new local merge commit.
'git pull origin master' will fetch and update only a specific branch called master and origin in the remote repository. Often, the default branch in Git is a master branch, and it keeps updating frequently. A user can use any branch name to pull that branch from the remote.
Remember, a pull is a fetch and a merge. git pull origin master fetches commits from the master branch of the origin remote (into the local origin/master branch), and then it merges origin/master into the branch you currently have checked out.
pull
is a combination command, fetch
followed by merge
. With default or sensible params it will synchronize your current branch.
With the params as in question most of its work is sabotaged. the fetch part is overruled to use the current repo, so that is skipped, and you explicitly ask master overruling FETCH_HEAD.
So in that form I believe they are identical (and I'd put the first in nonsense category too).
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