Git branch -r 無法獲取遠程分支,ui可以看見分支但是git 命令無法查看解決方案


zhc@hongchangfirst$ git checkout -b hongchangfirst origin/hongchangfirst

出現:

fatal: Cannot update paths and switch to branch 'hongchangfirst' at the same time.

Did you intend to checkout 'hongchangfirst' which can not be resolved as commit?

 

然后我們執行命令:

git branch -a

里邊並不包含遠程都hongchangfirst分支。

 

遠程倉庫明明有hongchangfirst分支,可是為什么告訴沒有呢?

原來這條命令並沒有每一次都從遠程更新倉庫信息,這樣子做是為了效率,我們可以手動更新一下:

 

git fetch origin

然后我們在git branch -a

發現了我們都遠程分支,然后我們在做新建一個分支:

git checkout -b hongchangfirst origin/hongchangfirst


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM