git问题 next fetch will store in remotes/origin

时间:2023-03-10 05:24:50
git问题 next fetch will store in remotes/origin

项目在git的下无法查找到需要的Branch

git问题 next fetch will store in remotes/origin

但是在Bitbucket下可以查到到

git问题 next fetch will store in remotes/origin

通过GitBash,发现git branch -a与git remote show origin 输出的远程分支不一样,git remote show origin命令输出多余的分支:
branch_XXXX_XXXX   new ( next fetch will store in remotes/origin)

这是因为it branch -a 输出的是本地仓库的远程分支信息,而git remote show origin需要联网输出实时的远程仓库的分支信息。
出现new ( next fetch will store in remotes/origin),由于远程新增了分支,而本地并没有同步信息导致的。

解决方法:git fetch origin  //从远程仓库更新信息

这时在switch/checkout的branch中就可以找到新增的分支信息,切换到新分支即可。