命令 git pull
一、命令语法
git pull <remote> <branch>
比如从GitHub拉取代码到本地,比如本地初始化目录,拉取代码
$ git init
$ git remote add origin git@github.com:qicongmark/jeeweixin.git
$ git branch -M master
#拉取远程分支代码到本地分支
$ git pull origin master
二、错误提示
如果使用 git pull
命令,提示如下信息:
There is no tracking information for the current branch.
Please specify which branch you want to merge wit
See git-pull(1) for details.
git pull <remote> <branch>
If you wish to set tracking information for this branch you can do so with:
git branch --set-upstream-to=origin/<branch> master
可以执行如下命令
#本地分支(master)关联远程(origin/master)分支
$ git branch --set-upstream-to=origin/master master
#再git pull就可以了
$ git pull