git 新建分支后,当执行git pull 拉代码的时候会报错

Remote origin did not advertise Ref for branch 0404birthday. This Ref may not exist in the remote or may be hidden by permission settings.

git 命令行提示内容如下:

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> 0404birthday

就是需要指定本地projet分支,跟远程仓库项目分支之间的关系,比如,我们需要本地master对应远程的master

git branch --set–upstream master origin/master

我新建一个 0404birthday分支 需要和远程日常开发的分支相连接

执行命令:

git branch --set-upstream-to=origin/develop 0404birthday
git pull

OK

Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐