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