在使用git更新命令时,产生错误:
fatal: Untracked working tree file 'res/values/isdm_mms_defaults.xml' would be overwritten by merge.
请问这个错误是什么原因引起的?该怎么解决呢?

解决方案 »

  1.   

    So, at least for any normal switch, assuming file 'a' doesn't exist in the 
    other branch, you really should have a few different cases: - you have a dirty file, and git should say something like error: You have local changes to 'file'; cannot switch branches.   because it refuses to modify the file to match the other branch (which 
       includes removing it) if it doesn't match the index.   So this case shouldn't leave anything behind. - You have that extra file, but it's not in the index.   If it's in your current HEAD, we should still notice it with something 
       like: error: Untracked working tree file 'tree' would be removed by merge.   because now it's untracked (not in the index), but the switching 
       between branches tries to essentially "apply" the difference between 
       your current HEAD and the new branch, and finds that the difference 
       involves removing a file that git isn't tracking.
      

  2.   

    你可以先 git checkout --这个文件,然后再重新git