git报错 Cannot update paths and switch to branch 'snapshot_mixuse' at the same time.

错误如下:

  
  
  1. dmj-parent git:(master) git checkout -b snapshot_mixuse --track origin/snapshot_mixuse
  2. fatal: Cannot update paths and switch to branch 'snapshot_mixuse' at the same time.
  3. Did you intend to checkout 'origin/snapshot_mixuse' which can not be resolved as commit?
  4.  dmj-parent git:(master) git remote show origin
  5. * remote origin
  6.  Fetch URL: git@git.superboss.cc:dmj/jxc.git
  7.  Push  URL: git@git.superboss.cc:dmj/jxc.git
  8.  HEAD branch: master
  9.  Remote branches:
  10.    master          tracked
  11.    snapshot        tracked
  12.    snapshot-item   tracked
  13.    snapshot_mixuse new (next fetch will store in remotes/origin)
  14.    snapshot_wlb    tracked
  15.  Local branches configured for 'git pull':
  16.    master        merges with remote master
  17.    snapshot      merges with remote snapshot
  18.    snapshot-item merges with remote snapshot-item
  19.  Local refs configured for 'git push':
  20.    master        pushes to master        (local out of date)
  21.    snapshot      pushes to snapshot      (local out of date)
  22.    snapshot-item pushes to snapshot-item (up to date)
  23.  dmj-parent git:(master)
解决思路:
  
  
  1.  dmj-parent git:(master) git remote update
  2. Fetching origin
  3. remote: Counting objects: 28, done.
  4. remote: Compressing objects: 100% (22/22), done.
  5. remote: Total 28 (delta 14), reused 0 (delta 0)
  6. Unpacking objects: 100% (28/28), done.
  7. From git.superboss.cc:dmj/jxc
  8. * [new branch]      snapshot_mixuse -> origin/snapshot_mixuse
  9.   275fed2..b289f38  snapshot_wlb -> origin/snapshot_wlb
  10.  dmj-parent git:(master) git fetch
  11.  dmj-parent git:(master) git checkout -b snapshot_mixuse origin/snapshot_mixuse
  12. Branch snapshot_mixuse set up to track remote branch snapshot_mixuse from origin.
  13. Switched to a new branch 'snapshot_mixuse'



Logo

开放原子开发者工作坊旨在鼓励更多人参与开源活动,与志同道合的开发者们相互交流开发经验、分享开发心得、获取前沿技术趋势。工作坊有多种形式的开发者活动,如meetup、训练营等,主打技术交流,干货满满,真诚地邀请各位开发者共同参与!

更多推荐