2
我有兩個文件已經添加並在git中提交。git錯誤地將文件標記爲重命名
報告
report_dates
現在,我已經修改了兩個文件,我試圖犯下但混帳不正確標記report_dates文件改名後,我將它們添加到臨時區域。
> git status
On branch 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: report
modified: report_dates
> git add report
> git add report_dates
> git status
On branch master
Changes to be committed:
(use "git reset HEAD <file>..." to unstage)
renamed: report_dates -> report
modified: report_dates
我嘗試使用git的承諾--dry運行,並且也顯示了文件改名驗證。將提交覆蓋原始文件?有兩個不同的文件,其中90%的內容類似。
這是git的工作原理。有時如果文件內容變化太大,它不會檢測到實際的重命名。你應該接受它並繼續:) – 2014-10-12 13:29:33
同樣在http://stackoverflow.com/q/26273245/6309:* commit後的git status *會起作用。 – VonC 2014-10-12 13:54:05
Thanks @VonC'git commit --dry-run'將它顯示爲重命名。我還能繼續前進嗎? @AlexMDC這不是重命名,但git將其報告爲重命名。 – nshaik 2014-10-12 15:03:51