Git uncommited更改不可承诺

时间:2015-07-02 06:27:58

标签: git

我在最后一次拉动后有一个奇怪的文件,标记为未提交,我无法提交。该文件似乎已在远程重命名为ContactNameFilter.ts -> contactNameFilter.ts

$ git status

On branch <<...>>
Your branch is up-to-date with 'origin/<<...>>'.
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:   app/scripts/filters/ContactNameFilter.ts

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

$ git commit -a

On branch <<...>>
Your branch is up-to-date with 'origin/<<...>>'.
Changes not staged for commit:
    modified:   app/scripts/filters/ContactNameFilter.ts

no changes added to commit

$ git add -A
$ git commit

On branch <<...>>
Your branch is up-to-date with 'origin/<<...>>'.
Changes not staged for commit:
    modified:   app/scripts/filters/ContactNameFilter.ts

no changes added to commit

这怎么可能,怎么做呢?

差异:

-  export var ContactNameFilter: Function = function(): Function {
+  export var contactNameFilter: Function = function(): Function {

1 个答案:

答案 0 :(得分:3)

尝试明确删除文件,然后再明确地再次添加:

git rm --cached app/scripts/filters/ContactNameFilter.ts
git add app/scripts/filters/ContactNameFilter.ts

即使文件系统由于不区分大小写而出现问题,这也应该有效。