在切换分支时 提示:
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:
- delete the file in your existing directory (I just moved it somewhere out of the working tree initially to be safe) of branch B
- check out the branch you want - i.e. branch A
- Remove it from branch A using something like this:
git rm --cached app.xcodeproj/project.xcworkspace/xcuserdata/u.xcuserdatad/UserInterfaceState.xcuserstate - git commit -m "Removed file that shouldn't be tracked"
Note: Fwiw, Branch A was my master branch. Branch B was my dev branch.