0

I have added the following line to my .gitignore file:

# Ignore the secrets.yml file for storing keys
config/secrets.yml

But it is still syncing the secrets.yml file with the repo. I also tried

# Ignore the secrets.yml file for storing keys
/config/secrets.yml

Is there something else I need to do or an I using the wrong syntax there?

rob
  • 2,136
  • 8
  • 29
  • 37
glimmer
  • 577
  • 4
  • 7

2 Answers2

1

This may not be an ideal solution but it's worked for me when I've added xxxxxx.yml to .gitignore after already having committed it.

  1. Open your config directory
  2. Move the YML to another directory
  3. Commit and push your git repo
  4. Add the YML file back into your config directory

Again, may be a more ideal way but this has always worked for me.

craig.kaminsky
  • 5,588
  • 28
  • 31
  • Thanks for that, but I did not want to exclude all .yml files. My issues was solved by this previous question,"Making git “forget” about a file that was tracked but is now in .gitignore ". The problem was the files already tracked and needed to be removed from the cache. – glimmer Jun 26 '15 at 17:05
  • Yes, which is what I was saying to do ("the YML" to another directory ... not all YML :)). I typically space out on a new app and inadvertently commit database.yml and secrets.yml to my repo. Glad you got it sorted out. – craig.kaminsky Jun 26 '15 at 17:06
0

In which file have you had this line? To exclude a file of my git repository, I had it in

YOUR_REPO/.git/info/exclude

And I think, you should remove it of your repository...

I hope that will be helpfull

  • My issues was solved by this previous question,"Making git “forget” about a file that was tracked but is now in .gitignore ". The problem was the files already tracked and needed to be removed from the cache. – glimmer Jun 26 '15 at 17:06