git pull command
git pullThe command is used to fetch code from a remote repository and merge it with the local version.
git pullitsrealJustYesgit fetchandgit mergeabbreviation of ..., first fetch the latest commit records from the remote repository, then merge these commit records into your current branch.
The command format is as follows:
git pull [远程仓库名] [分支名]
[Remote repository name]usuallyorigin, is the default remote repository name.[Branch name]is the remote branch you want to merge, for examplemainormaster。
Example
Update operation:
$ git pull $ git pull origin
Pull the master branch from the remote host origin and merge it with the local brantest branch.
git pull origin master:brantest
If the remote branch is merged with the current branch, the part after the colon can be omitted.
git pull origin master
The above command means fetching the origin/master branch and merging it with the local brantest branch.
The above pull operation can be expressed using fetch as:
with myhttps://github.com/tianqixin/example-git-testas an example, fetch the remote and merge it into the local branch.
$ git remote -v # 查看信息 origin https://github.com/tianqixin/example-git-test (fetch) origin https://github.com/tianqixin/example-git-test (push) $ git pull origin master From https://github.com/tianqixin/example-git-test * branch master -> FETCH_HEAD Already up to date.
The above command means fetching the origin/master branch and merging it with the local master branch.
other extensions