现在的位置: 首页 > 综合 > 正文

xcode git 切换分支出错

2013年10月01日 ⁄ 综合 ⁄ 共 642字 ⁄ 字号 评论关闭

在切换分支时 提示:  

Working copy is modified

经过google 终于得到答案

So, the solution is this:

The file is untracked in this current branch B

But it exists in the branch we are trying to check out, branch A, so we get a warning that the file in our current working tree will be overwritten (even though we aren't tracking it)

So:

  1. delete the file in your existing directory (I just moved it somewhere out of the working tree initially to be safe) of branch B
  2. check out the branch you want - i.e. branch A
  3. Remove it from branch A using something like this:
    git rm --cached app.xcodeproj/project.xcworkspace/xcuserdata/u.xcuserdatad/UserInterfaceState.xcuserstate
  4. git commit -m "Removed file that shouldn't be tracked"

Note: Fwiw, Branch A was my master branch. Branch B was my dev branch.


抱歉!评论已关闭.