Why can I not switch branches?

后端 未结 7 1069
故里飘歌
故里飘歌 2020-12-13 23:29

I\'m trying to switch branches in git but I\'m getting this error message:

error: you need to resolve your current index first

I\'m using g

7条回答
  •  借酒劲吻你
    2020-12-14 00:12

    Since the file is modified by both, Either you need to add it by

    git add Whereami.xcodeproj/project.xcworkspace/xcuserdatauser.xcuserdatad/UserInterfaceState.xcuserstate
    

    Or if you would like to ignore yoyr changes, then do

    git reset HEAD Whereami.xcodeproj/project.xcworkspace/xcuserdatauser.xcuserdatad/UserInterfaceState.xcuserstate
    

    After that just switch your branch.This should do the trick.

提交回复
热议问题