xcode git 切换分支出错
2013-09-05 14:20
211 查看
在切换分支时 提示:
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.
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.
相关文章推荐
- idea项目切换git远程分支出错
- git切换分支保存修改的代码的方法
- git切换到远程分支
- GIT本地切换远程分支
- git切换到远程分支
- git切换分支
- Git知识总览(三) 分支的创建、删除、切换、合并以及冲突解决
- git 新建分支/切换分支/合并分支 使用方法
- git命令-切换分支
- git 分支无法切换问题
- 不幸的问题还是出现了:Chromium代码上整理patch(working目录/master分支),部分文件做了git checkout恢复,结果GYP再编译就出错了
- git分支切换问题
- git——切换分支
- git上找不到远程分支,直接切换报错error: pathspec 'origin/XXX' did not match any file(s) known to git.
- git切换远程库 创建分支并提交到远程
- git切换分支命令流程
- Git 修复 bug 切换分支时,如何保存修改过的代码(即如何保存现场)?
- git切换分支
- git切换远程分支
- git 切换分支常用命令