2012-07-18 60 views
0

我遇到了Aptana 3的問題。我可以從github克隆項目。但我的問題是,gitignore文件無法正常工作。當我修改gitignore列表中的文件時,它仍然將其顯示在修改或提交列表中。.gitignore文件不工作在Aptana 3

如果我通過控制檯執行git init,則Aptana ui不會顯示文件修改。當我通過UI初始化它時,修改後的文件會在修改時顯示星號,但gitignore文件(從github存儲庫中預先存在)不起作用。有沒有簡單的方法呢?

謝謝。在我gitignore文件

config/database.yml 

修改此文件

例子仍然顯示 enter image description here

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 
+0

你可以請你發佈你的.gitignore文件和提交的文件名嗎? – leopic 2012-07-18 23:32:39

+0

添加代碼片段的照片 – HelloWorld 2012-07-18 23:37:49

+0

您是否還可以在控制檯上將'git status'的命令行輸出粘貼到aptana隱藏存儲庫的位置? – 2012-07-18 23:52:21

回答

2

的config/database.yml中已經被承諾。此時.gitignore不再參與其中。 .gitignore只適用於尚未被git追蹤的文件。如果您對不想共享的文件進行了自定義修改,請參閱https://gist.github.com/1423106瞭解人們解決問題的方式。

+0

+1謝謝,聲明「.gitignore只適用於尚未被git跟蹤的文件」幫助我找出了一個解決方案。 – HelloWorld 2012-07-19 17:45:14

+0

@HelloWorld:那麼請接受。 – 2012-07-19 17:47:18

+0

做一次拉後它再也不會出現同樣的問題:( – HelloWorld 2012-07-19 18:20:10

0

您可能會遇到我剛纔在這裏看到的問題。它看起來像構建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" 
0

您可能必須以有集錦忽略文件到本地提交您的.gitignore文件。

只是要小心,不要把它推到原點。