【问题标题】:.gitignore file not working in Aptana 3.gitignore 文件在 Aptana 3 中不起作用
【发布时间】:2012-07-18 23:29:54
【问题描述】:

我在使用 Aptana 3 时遇到问题。我可以从 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

【问题讨论】:

  • 能否请您发布您的 .gitignore 文件和提交的文件名?
  • 添加了 sn-p 代码的照片
  • 您能否也将git status 的命令行输出粘贴到 aptana 隐藏存储库的控制台上。

标签: git version-control github aptana aptana3


【解决方案1】:

config/database.yml 已经提交。此时 .gitignore 不再涉及。 .gitignore 仅适用于 git 尚未跟踪的文件。如果您对不希望共享的文件进行了自定义修改,请参阅 https://gist.github.com/1423106 了解人们解决此问题的方法。

【讨论】:

  • +1 谢谢,声明“.gitignore 仅适用于 git 尚未跟踪的文件”帮助我找到了解决方案。
  • 在拉动后没关系,它再次出现同样的问题:(
  • 也许您应该创建一个新问题或使用您试图用来绕过修改跟踪文件问题的协议更新此问题。请注意,除了我包含的链接中描述的技术之外,我不知道任何其他有效的方法。
【解决方案2】:

您可能已经被我刚刚在这里看到的一个问题所困扰。从 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"

【讨论】:

    【解决方案3】:

    您可能必须在本地提交您的 .gitignore 文件才能让 Aptana 忽略这些文件。

    注意不要把它推到原点。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-21
      • 2014-01-29
      • 1970-01-01
      • 2023-04-04
      相关资源
      最近更新 更多