简体   繁体   中英

.gitignore file not working in Aptana 3

I'm having issues with Aptana 3. I can git clone a project from github. But my issue is that the gitignore file is not working properly. When I modify a file that is in the gitignore list, it still shows it in a modify or commit list.

If I do a git init through the console, the Aptana ui doesn't show file modifications. 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. Is there an easy way around this?

Thanks.

example in my gitignore file

config/database.yml

Modifying this file still shows 在此输入图像描述

Git status returns the following...

$ 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. At this point .gitignore is no longer involved. .gitignore only applies to files not yet tracked by 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.

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.

If you commit without restarting it will whatever is in the commit window regardless of what's in .gitignore :(

As for getting your file out of git, the following commands should help

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.

Just be careful to not push it to the origin.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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