Ruby on Rails Saturday, July 3, 2010

The .gitignore file should be created in the root directory of your rails project. It tells git which files to ignore when looking at files to commit, for whatever reason. So create a .gitignore file (like you would any other file) and copy/paste this snippet in there.


Sample .gitignore file
.bundle
db/*.sqlite3
log/*.log
tmp/**/*
tmp/*
doc/api
doc/app
*.swp
*~
.DS_Store

It may look like a bunch of warlock magic, but it's not that complicated. You're essentially telling git to ignore:

.bundle files & .DS_Store - These files are used by MacOS to do MacOs stuff.

db/*.sqlite3 - All files inside the db folder that end with sqlite3 (test and dev stuff)

And so on.






On Fri, Jul 2, 2010 at 10:49 PM, Jeremy <bathrobewarrior@gmail.com> wrote:


On Jul 2, 10:32 pm, RailsFan Radha <li...@ruby-forum.com> wrote:
> .gitignore seems to be really cool.
> but where is this? what is the path for this file .gitignore?
>

The way I understand .gitignore is that it's just a hidden file that
lists what files you want git to ignore so it doesn't show up in your
repository.  It resides inside the folder of the app that directly
coincides with the file you want to ignore.  The way you do this is by
typing a command in your command line that tells Git to "ignore" the
file.

However, I don't understand it good enough yet to give you an example
because even though somehow I managed to accomplish the .gitignore
file and "ignore" my databese.yml file, I'm not sure I understand how
to do it again lol..

Do a search for .gitignore and there are several examples out there on
the web.  That's pretty much what I did, because for some reason
Githubs help page on gitignore doesn't really help you accomplish it,
it seems a bit cryptic if you ask me.  But if you want to check it
out, you can find the page here:  http://help.github.com/git-ignore/

Jeremy

--
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@googlegroups.com.
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.


--
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@googlegroups.com.
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.

No comments:

Post a Comment