我在Aptana 3上遇到了问题,我可以用git从github克隆一个项目。但我的问题是gitignore文件不能正常工作。当我修改gitignore列表中的文件时,它仍然在修改或提交列表中显示它。
如果我通过控制台执行git init,Aptana ui不会显示文件修改。当我通过UI初始化它时,被修改的文件在修改时会显示星号,但gitignore文件(预先存在于github存储库中)不起作用。有什么简单的方法可以解决这个问题吗?
谢谢。
我的gitignore文件中的示例
config/database.yml修改此文件仍会显示

Git状态返回以下内容...
$ git status
# On branch master
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# modified: .gitignore
#
# 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: Gemfile.lock
# modified: config/database.yml
#
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# .project发布于 2012-07-19 08:03:29
config/database.yml已提交。在这一点上,.gitignore不再参与其中。.gitignore只适用于尚未被git跟踪的文件。如果您对不希望共享的文件进行了自定义修改,请参阅https://gist.github.com/1423106了解人们解决此问题的方法。
发布于 2012-11-26 23:45:18
您可能被我在这里看到的一个问题所困扰。从build 3.2.2.201208201020开始,如果您打开提交窗口,然后编辑gitignore,您必须重新启动Aptana,然后它才会接受更改。
如果在不重新启动的情况下提交,则无论.gitignore中的内容是什么,提交窗口中的内容都将被提交:(
至于从git中获取文件,下面的命令应该会有所帮助
cp config/database.yml config/database.yml.example # backup the file
git rm config/database.yml # remove the original from git
git commit -m "Untrack database.yml"发布于 2013-07-20 02:10:00
为了让Aptana忽略这些文件,您可能必须本地提交您的.gitignore文件。
只是要小心不要把它推到原点。
https://stackoverflow.com/questions/11551873
复制相似问题