Git 问题整理

现象:

创建本地分支后,推送到服务端,不建立映射,再从服务端取数据会遇到问题,报错。但如果本地不存在该分支的情况下,从服务端直接pull 分支,这个时候push代码会没有问题。:
报错如下:

There is no tracking information for the current branch.
    Please specify which branch you want to merge with.
    See git-pull(1) for details

    git pull  

If you wish to set tracking information for this branch you can do so with:

    git branch --set-upstream develop origin/

解决方案是:

git pull origin master
Or you could set it up so that your local master branch tracks github master branch as an upstream:

git branch --set-upstream-to=origin/master master
git pull

你可能感兴趣的:(git-问题)