问题
在本地新创建了git分支并且有已经正常推送到过线上仓库
但是今天早上起来拉取最新代码提示如下,这个问题我遇到过好多次了,很有必要记一笔
分析
字面意思是说没有配置分支
进入你的项目,开启git命令行窗口,输入以下
git branch --set-upstream-to origin
结果提示如下
hint:
hint: If you are planning on basing your work on an upstream
hint: branch that already exists at the remote, you may need to
hint: run "git fetch" to retrieve it.
hint:
hint: If you are planning to push out
a new local branch that
hint: will track its remote counterpart, you may want to use
hint: "git push -u" to set the upstream config as you push.
后来直接执行如下,加入我新创建的分支名称v1.0.1
git branch --set-upstream-to origin/v1.0.1
结果如下
>git branch --set-upstream-to origin/v1.0.1
Branch 'v1.0.1' set up to track remote branch 'v1.0.1' from 'origin'.
好的,在工具中也能正常拉取和提交代码啦