Hi, I am running a Ruby project on c9. It seems however, that my .gitignore file does not work. Does anyone have a similar problem or know a solution?
As Cloud9 uses the standard git command, I’m not sure why there’s a problem with
.gitignore. Can you paste us a screenshot showing the problem?
.gitignore works just fine for me. The file must be in the root folder of your repository to apply though.
Thanks for the response. That is odd indeed. Im not an experienced user, so it might be I’m doing something wrong.
My latest pull:
My workspace/.gitignore file:
Both /log/development.log and /config/database.yml are overwritten in my pulls.
Am I missing something here?
Thanks in advance,
Remove the first forward slash. That’s implying that it should look at the root of the file system, not the current directory.
This is my .gitignore file. Note the lack of forward slashes. When you exclude a folder, its contents are ignored as well.
.bundle .DS_Store .sass-cache .gist-cache .pygments-cache _deploy public sass.old source.old source/_stash source/stylesheets/screen.css vendor node_modules Gemfile.lock
To add to @jms1989’s answer, and I could be wrong here, but once you’ve committed a file to your git, it will stay there regardless of your .gitignore setting. You will have to manually remove the files from source control using something like the
git rm command.
Thank you both for your answers, and I apologise for being .ignorant on this matter. It now works after removing the forward slashes and running the commands:
git rm --cached [path]
git update-index --assume-unchanged [path]
Thanks again. C9 is awsome!