2016-06-10 45 views
0

Git现在完全吓坏了我。我完全无法删除这些修改:Git将文件标记为已更改,无法检出或还原

On branch master 
Your branch is up-to-date with 'origin/master'. 
Changes not staged for commit: 
    (use "git add <file>..." to update what will be committed) 
    (use "git checkout -- <file>..." to discard changes in working directory) 

     modified: Exchange Plugins/VWSDK/SDKVW(234280)/Source/Samples/Stage 2/old resource/AOE_EN.r 
     modified: Exchange Plugins/VWSDK/SDKVW(234280)/Source/Samples/Stage 2/old resource/AOE_NL.r 
     modified: Exchange Plugins/VWSDK/SDKVW(234280)/Source/Samples/Stage 2/old resource/Afvoerleiding_NL.r 
     modified: Exchange Plugins/VWSDK/SDKVW(234280)/Source/Samples/Stage 2/old resource/EditLicense_NL.r 
     modified: Exchange Plugins/VWSDK/SDKVW(234280)/Source/Samples/Stage 2/old resource/Guideline_NL.r 
     modified: Exchange Plugins/VWSDK/SDKVW(234280)/Source/Samples/Stage 2/old resource/Leiding3D_NL.r 
     modified: Exchange Plugins/VWSDK/SDKVW(234280)/Source/Samples/Stage 2/old resource/RV_NL.r 
     modified: Exchange Plugins/VWSDK/SDKVW(234280)/Source/Samples/Stage 2/old resource/Radiator_NL.r 
     modified: Exchange Plugins/VWSDK/SDKVW(234280)/Source/Samples/Stage 2/old resource/ReplaceSymbol_EN.r 
     modified: Exchange Plugins/VWSDK/SDKVW(234280)/Source/Samples/Stage 2/old resource/ReplaceSymbol_NL.r 

no changes added to commit (use "git add" and/or "git commit -a") 

但我从来没有改变这些文件,没有别的。他们来自一些SDK,真的不应该被触摸。使用git diff -R表明,它似乎有些行尾问题:

λ git diff -R 
diff --git b/Exchange Plugins/VWSDK/SDKVW(234280)/Source/Samples/Stage 2/old resource/AOE_EN.r a/Exchange Plugins/VWSDK/SDKVW(234280)/Source/Samples/Stage 2/old resource/AOE_EN.r 
index ef6bf97..e7cb032 100755 
--- b/Exchange Plugins/VWSDK/SDKVW(234280)/Source/Samples/Stage 2/old resource/AOE_EN.r 
+++ a/Exchange Plugins/VWSDK/SDKVW(234280)/Source/Samples/Stage 2/old resource/AOE_EN.r 
@@ -1,27 +1,27 @@ 
-#ifndef REZ_FOR_MACHO 
-  #define REZ_FOR_MACHO 0 
-#endif 
- 
-#if REZ_FOR_MACHO 
-  #include <Carbon/Carbon.r> 
-#else 
-  #include "MacTypes.r" 
-#endif 
- 
-#include "GSRsrc.r" 
- 
-// ------------------------------------------------------------------------------------------------------------ 
-// The parametric object resources 
-resource 'STR#' (18200, "CExtObj") { 
-  { 
-  /* 1 */    "Organisation - Objects", 
-  /* 2 */    "Organisation - Objects", 
-  /* 3 */    "HVACS", 
-  /* 4 */    "Extension Tool : Do something", 
-  } 
-}; 
- 
-resource 'TEXT' (18200, "CExtObjAdvComplex:help") { 
-  "some help\n\n" 
-  "Create a radiator." 
-}; 
+#ifndef REZ_FOR_MACHO^M 
+  #define REZ_FOR_MACHO 0^M 
+#endif^M 
+^M 
+#if REZ_FOR_MACHO^M 
+  #include <Carbon/Carbon.r>^M 
+#else^M 
+  #include "MacTypes.r"^M 
+#endif^M 
+^M 
+#include "GSRsrc.r"^M 
+^M 
+// ------------------------------------------------------------------------------------------------------------^M 
+// The parametric object resources^M 
+resource 'STR#' (18200, "CExtObj") {^M 
+  {^M 

我已经试过:

  • git reset --hard
  • git checkout .
  • git stash(导致文件被藏匿,但“变化”仍然存在于本地)
  • core.autocrlf on inputfalsetrue,在全球和本地和从上面的所有命令再次

的唯一的事情是“工作”犯下这些明显的“修改”。但是我从另一个分支中完成了这项工作,现在我无法合并到master中,因为这些“更改”仍然存在,它告诉我在合并之前提交或隐藏更改。

使用git version 2.7.4.windows.1

+0

git藏匿应该做你想要的。当你执行'git stash'和'git status'时会发生什么? –

+0

你尝试过'git reset --soft HEAD〜1'吗? – Baruch

+0

@MartinGottweis当我做'git stash'时,我在存储器中以及当前的工作目录中都有“更改”。因此'git status'在'git stash'后显示相同' –

回答

0

我认为,问题是你有分离的头。

尝试运行git checkout -b newbranch然后git stash

也就是你有CINEMA 4D运行,这是防止从混帐删除文件的机会吗?

+0

HEAD被分离并不是问题。我继续承诺这些“改变”,否则我将无法继续工作。要录制视频,我回到之前的提交,因此分离的HEAD状态。 –

+0

为了进一步说服你,我遵循了你描述的步骤:https://vid.me/7OpZ –

+0

我喜欢视频;-)。你可以尝试手动重命名其中一个文件吗? –