Hi, For some reason git is not ignoring my database.yml file even though I have config/database.yml in my .gitignore file. Any suggestions as to what the problem might be and/or how I can fix it? It''s causing major annoyances. Is there a way to remove the database.yml from the repo entirely? Thanks! --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On Dec 11, 11:29 am, jgoggles <daniel.wea...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi, > > For some reason git is not ignoring my database.yml file even though I > have config/database.yml in my .gitignore file. Any suggestions as to > what the problem might be and/or how I can fix it? It''s causing major > annoyances. Is there a way to remove the database.yml from the repo > entirely? > > Thanks!If it got added to your git repo before you specified it in the ignore file, I think you have to remove it: git rm config/database.yml git commit -a -m "Removed database.yml" (maybe save a backup of your database.yml first :-) Jeff --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
> If it got added to your git repo before you specified it in the ignore > file, I think you have to remove it: > > git rm config/database.yml > git commit -a -m "Removed database.yml" > > (maybe save a backup of your database.yml first :-) > > JeffWhat I do is rename database.yml to example_database.yml before the initial commit to git (and have config/database.yml in .gitignore. Then after the initial commit I copy example_database.yml back to database.yml, which will not be ignored. Git will only ignore untracked files that are in .gitignore. If you are tracking changes to a file the .gitignore has no effect. The reason I keep example_database.yml in Git is so that when the repository is cloned all I have to do is copy example_database.yml to database.yml and I''m ready to go in the clone. Note: this way each developer can keep their database password in their own untracked copy of database.yml if a password is required. But, they won''t have to recreate database.yml from scratch. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Oh! In fact I don''t actually do any of that manually, but instead I use a simple Ruby script that I wrote (before discovering there are probably better ways to this, and now Rails Edge has a really cool new template system for doing this sort of thing). If interested you can find the script here... http://github.com/robertwalker/git-a-rails-project/tree See the README for usage and options. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Jeff Cohen wrote:> > If it got added to your git repo before you specified it in the ignore > file, I think you have to remove it: > > git rm config/database.yml > git commit -a -m "Removed database.yml" > > (maybe save a backup of your database.yml first :-) > > JeffSafer I think to: # git status # git rm config/database.yml --cache --cache should leave the actual file alone and just remove it from tracking> Backups are always a good thing though. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Very helpful. Thanks guys! On Dec 11, 2:12 pm, James Byrne <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Jeff Cohen wrote: > > > If it got added to your git repo before you specified it in the ignore > > file, I think you have to remove it: > > > git rm config/database.yml > > git commit -a -m "Removed database.yml" > > > (maybe save a backup of your database.yml first :-) > > > Jeff > > Safer I think to: > > # git status > # git rm config/database.yml --cache > > --cache should leave the actual file alone and just remove it from > tracking> Backups are always a good thing though. > -- > Posted viahttp://www.ruby-forum.com/.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
> # git status > # git rm config/database.yml --cacheNotice: it''s --cached, not --cache. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.