views:

53

answers:

2

I had a file I needed to edit in my .gitignore file.

I edited .gitignore, committed it, and still my file was unavailable to commit.

I deleted the file, readded it, and once it has the same name, its still unavailable to commit.

I tried -f, which then added an empty version of the file to my repository. And the worst apart about that is that if I deployed, it would break my entire application at this point.

Update:

The file I want to add is :

 public/javascripts/ckeditor/config.js

my .gitignore file says :

 public/stylesheets/*.css
 *.swp
 *.pid
 .idea
 config/database.yml
 log/*.log
 db/*.sqlite3
 tmp/**/*
 doc/api
 doc/app
 doc/plugins
 public/system/*
 coverage.data
 coverage/*
 .DS_STORE
 .DS_Store
 solr/data/**/*
 solr/pids/**/*
 config/initializers/mail_delivery_override.rb

Git status reveals this :

  # On branch testing
  # Changed but not updated:
  #   (use "git add <file>..." to update what will be committed)
  #   (use "git checkout -- <file>..." to discard changes in working directory)
  #
  # modified:   public/javascripts/ckcustom.js
  #
  no changes added to commit (use "git add" and/or "git commit -a")

That ckcustom.js is a compiled file form the ckeditor suite that is made by other changes. But I can't just edit that file, I had to edit its inner workings.

A: 

Ok I'm pretty sure this worked, and this was really strange! Almost lost some dreadlocks over this one.

To begin, I logged in manually into my server, deleted the crappy file git had made. Recreated it, copied and pasted my file back in, and got my server back online.

Then I went to github.com and manually opened, edited, and committed the file right from the online API.

I readded the .gitignore file, and the ckcustom.js file, and the problem seems to be fixed.

Sheesh!

Trip
A: 

Next time try:

git add -f path/to/ignore_file
Winfield
I did as written above.
Trip