我在使用git时遇到了一个非常奇怪的问题,详情如下:
我从远程拉出一个包并且git状态显示它已更新到日期:
XXXService weiheng$ git status
On branch mainline
Your branch is up-to-date with 'origin/mainline'.
nothing to commit, working directory clean
XXXService weiheng$ git pull
Already up-to-date.
然后我修改了一个文件,git status show如下:
XXXService weiheng$ git status
On branch mainline
Your branch is up-to-date with 'origin/mainline'.
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: configuration/app/XXXService.conf
no changes added to commit (use "git add" and/or "git commit -a")
好的,现在一切看起来都很好。但是,当使用git add来进行更改时,还会添加三个额外的文件:
XXXService weiheng$ git add configuration/app/XXXService.cfg
XXXService weiheng$ git status
On branch mainline
Your branch is up-to-date with 'origin/mainline'.
Changes to be committed:
(use "git reset HEAD <file>..." to unstage)
modified: configuration/app/XXXService.conf
new file: configuration/tomcat-setup-env-Alpha/RemoteDebugging.xml
new file: configuration/tomcat-setup-env-Beta/RemoteDebugging.xml
new file: configuration/tomcat-setup-env-Gamma/RemoteDebugging.xml
我没有在git中设置任何钩子。我尝试将这三个文件重置为HEAD,但它确实有效,git status显示与上面相同。
XXXService weiheng$ git reset HEAD configuration/tomcat-setup-env-Alpha/RemoteDebugging.xml
XXXService weiheng$ git status
On branch mainline
Your branch is up-to-date with 'origin/mainline'.
Changes to be committed:
(use "git reset HEAD <file>..." to unstage)
modified: configuration/app/XXXService.conf
new file: configuration/tomcat-setup-env-Alpha/RemoteDebugging.xml
new file: configuration/tomcat-setup-env-Beta/RemoteDebugging.xml
new file: configuration/tomcat-setup-env-Gamma/RemoteDebugging.xml
提前致谢!并期待......
答案 0 :(得分:0)
我的假设是当你修改conf文件时,它也可能正在写一些XML文件。请确认XML文件中发生了哪些更改