您的位置:首页 > 其它

Git本地分支与远程分支关联问题(git branch --set-upstream-to=origin/<branch> )

2017-08-02 17:16 549 查看
Git在本地新建分支后,必须要做远程分支关联。关联目的是如果在本地分支下进行git pull 和 git push操作时 ,不需要指定在命令行指定远程的分支. 推送到远程分支时,没有关联的情况下而且没有指定, git pull 的时候,就会提示你如下信息:

MacBook-Pro:projects user$ git pull
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 <remote> <branch>

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

git branch --set-upstream-to=origin/<branch> pj-risk


解决方法:

使用命令git branch –set-upstream ; test为创建的分支

$ git branch --set-upstream debug origin/test
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: