eclips git中的add to Index无效解决

今天在使用eclips git中的add to Index,发现其无效,具体如下

问题描述:

通过export导入一个git java项目

在java工程中新增一个类文件IndicatorCalcTest.java

在eclips中选择该文件,team->add to Index,操作后该文件未显示+号

问题定位:

直接通过命令行进入IndicatorCalcTest.java文件所在目录,命令执行git add IndicatorCalcTest.java,报如下错误

C:UsersAdministratorgitdzhyunFunctionTestDzhYunHttpApiTestsrc estjavac
omgwdzhyunhttptest>git add  IndicatorCalcTest.java
The following paths are ignored by one of your .gitignore files:
FunctionTest/DzhYunHttpApiTest/src/test/java/com/gw/dzhyun/httptest/IndicatorCal
cTest.java
Use -f if you really want to add them.
fatal: no files added
 
问题解决
在百度中搜索The following paths are ignored by one of your .gitignore files:,找到如下文章
http://www.bestphper.cn/article-264.html
具体内容可访问链接,大概的意思.gitignore文件中有过滤,屏蔽了该文件
打开工程中.gitignore文件,内容如下
.settings
bin
target
src
猜想可能是把文件屏蔽了,去掉.gitignore文件的src行,保存。
再次在eclips中选择该文件,team->add to Index,操作后该文件显示+号
 
在此,问题解决
 
 
原文地址:https://www.cnblogs.com/xywq/p/4612355.html