简体   繁体   English

.gitignore文件在Aptana 3中不起作用

[英].gitignore file not working in Aptana 3

I'm having issues with Aptana 3. I can git clone a project from github. 我遇到了Aptana 3的问题。我可以从github git克隆一个项目。 But my issue is that the gitignore file is not working properly. 但我的问题是gitignore文件无法正常工作。 When I modify a file that is in the gitignore list, it still shows it in a modify or commit list. 当我修改gitignore列表中的文件时,它仍然会在修改或提交列表中显示它。

If I do a git init through the console, the Aptana ui doesn't show file modifications. 如果我通过控制台执行git init,Aptana ui不会显示文件修改。 When I initialize it through the UI, then files that are modified show the asterisk when modified, but the gitignore file (preexisting from the github repository) is not working. 当我通过UI初始化它时,修改后的文件会在修改时显示星号,但gitignore文件(预先存在于github存储库中)不起作用。 Is there an easy way around this? 有一个简单的方法吗?

Thanks. 谢谢。

example in my gitignore file 我的gitignore文件中的示例

config/database.yml

Modifying this file still shows 修改此文件仍然显示 在此输入图像描述

Git status returns the following... 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

config/database.yml has already been committed. config / database.yml已经提交。 At this point .gitignore is no longer involved. 此时.gitignore不再参与其中。 .gitignore only applies to files not yet tracked by git. .gitignore仅适用于尚未被git跟踪的文件。 If you have custom modifications to files which you do not wish to share, see https://gist.github.com/1423106 for ways people have worked around the problem. 如果您对不希望共享的文件进行自定义修改,请参阅https://gist.github.com/1423106以了解人们解决问题的方法。

You might have been bit by a problem that I just saw here. 您可能会遇到我刚才看到的问题。 It looks like as of build 3.2.2.201208201020, if you open the commit window, then edit gitignore you have to restart Aptana before it will pick up the changes. 它看起来像构建3.2.2.201208201020,如果你打开提交窗口,然后编辑gitignore你必须重新启动Aptana才能获得更改。

If you commit without restarting it will whatever is in the commit window regardless of what's in .gitignore :( 如果你提交没有重新启动它将提交窗口中的任何内容,无论在.gitignore中是什么:(

As for getting your file out of git, the following commands should help 至于从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"

You may have to locally commit your .gitignore file in order to have Aptana ignore the files. 您可能必须在本地提交.gitignore文件才能让Aptana忽略这些文件。

Just be careful to not push it to the origin. 小心不要把它推到原点。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM