Just started a new project and I''ve decided to give GIT a whirl to see if I like it. The first thing that has me stumbling a little is the best way to add files to a git repository when you generate a new model/scaffold/ controller. Let''s say I add a new scaffold, which creates a dozen files or so. I know I can ''git add path/to/file'' for each new file. Could I just ''git add .'' instead? Seems like ''git add .'' is a lot easier and makes committing quicker. Good? Bad? A better way? --~--~---------~--~----~------------~-------~--~----~ 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 25 Mar 2008, at 23:54, Karl Smith wrote:> Just started a new project and I''ve decided to give GIT a whirl to see > if I like it. > > The first thing that has me stumbling a little is the best way to add > files to a git repository when you generate a new model/scaffold/ > controller. Let''s say I add a new scaffold, which creates a dozen > files or so. I know I can ''git add path/to/file'' for each new file. > Could I just ''git add .'' instead? > > Seems like ''git add .'' is a lot easier and makes committing quicker. > > Good? Bad? A better way?git add . will just queue any new and modified files in the current for commit. If that''s what you''re looking into doing, there''s nothing wrong with it. Best regards Peter De Berdt --~--~---------~--~----~------------~-------~--~----~ 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 Tue, Mar 25, 2008 at 6:54 PM, Karl Smith <threadhead-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Just started a new project and I''ve decided to give GIT a whirl to see > if I like it. > > Seems like ''git add .'' is a lot easier and makes committing quicker. > > Good? Bad? A better way?That''s what I''ve been doing. If this is your first experience with git, you might be surprised to learn that git does not track empty directories, which may cause you some grief if you plan on cloning your repository. A workaround, given in the git FAQ, is to place an empty .gitignore file in those directories. I''ve started doing this: $ find . -type d -empty -exec touch {}/.gitignore \; Then, as long as I''m fiddling with .gitignore files, I put "*.log" into log/.gitignore. I put "*.sqlite3" in db/.gitignore. (I''ve only ever played with sqlite3 databasen.) Finally, being a big fan of Emacs, I put "*~" into the top level .gitignore file. (If you are unfamiliar with Emacs, it saves backup files with a "~" extension.) I do all of this just after executing: $ rails new_app $ cd new_app and before executing $ git init $ git add . $ git commit -m "Create new RoR app" and is based on a whole week or two worth of experience with rails. :-) --wpd --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---