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

来源:互联网 发布:linux您的ip被占用 编辑:程序博客网 时间:2024/05/11 15:35

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

MacBook-Pro:projects user$ git pullThere 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
阅读全文
1 0
原创粉丝点击