2

I'm using the cloud9 IDE with Ruby on Rails and having an issue with git.

I have a folder in my workspace called .c9 which contains all the cloud9 related files including it's regularly changing metadata.

I've added an ignore to my gitignore but keeps pushing to my bitbucket repository anyway. Worse when I branch off the metadata contained within goes out of sync and git insist i have to resolve the issue before I merge back.

I have no idea what I'm doing wrong here.

My gitignore looks like this:

# Ignore the c9 files. /.c9

I have also tried .c9, /.c9/*, .c9/* but no joy...

I've checked to see that it is actually in my workspace with la returning:

.c9/
.gitignore
Gemfile.lock
README.md
Todo.md
bin/
config.ru
lib/
public/
test/
vendor
.git/
Gemfile
Guardfile
Rakefile
app/
config/
db/
log/
spec/
tmp/

Any thoughts on where I'm going wrong?

Huw
  • 635
  • 11
  • 25
  • 4
    Your folder won't get ignored as long as it's being tracked. You can untrack it by running `git rm --cached s9/`. For more details, see, for instance, http://stackoverflow.com/questions/25700186/ds-store-still-appears-in-git-status-despite-being-in-gitignore/25700217#25700217 – jub0bs Oct 13 '14 at 17:28
  • Many thanks the link and your advice solved my issue. – Huw Oct 14 '14 at 11:04
  • possible duplicate of [Git diff doesn't ignore specified files in .gitignore](http://stackoverflow.com/questions/17820056/git-diff-doesnt-ignore-specified-files-in-gitignore) – jub0bs Oct 14 '14 at 12:01

1 Answers1

5

I can confirm as per Jubobs comment above my solution in this case was resolved by running:

git rm --cached .c9/ -r

and then ensuring my gitignore featured the following lines

#Ignore all .c9 specific files<br> /.c9/

I agree this is perhaps a duplicate of this question here: .DS_Store still appears in git status despite being in .gitignore

However as I went looking for a cloud9 specific answer perhaps this is still of use to some.

Huw
  • 635
  • 11
  • 25
  • Thank you this is what I was looking for. Note, I had to run git rm --cached .c9/ -r otherwise I would get a "fatal: not removing '.c9/' recursively without -r" message. – sf2k Mar 24 '15 at 20:39