I''m rather new to Git and trying to learn it. I did a new branch. I switched over to the new branch by checkout. I added some files and some code, directly in Textmate. But when I switched back to my master branch the same new files are there too. Isn''t that wrong? -- 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 -~----------~----~----~----~------~----~------~--~---
Did you remember to commit the new files before switching back to master? 2009/3/16 Pål Bergström <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>> > I''m rather new to Git and trying to learn it. > > I did a new branch. I switched over to the new branch by checkout. I > added some files and some code, directly in Textmate. But when I > switched back to my master branch the same new files are there too. > Isn''t that wrong? > -- > 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On 03/16/2009 04:34 PM, Colin Law wrote:> Did you remember to commit the new files before switching back to master? >What if I can''t/don''t want to commit now? Should I stage my files? Thanks, davi --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Git has a magic command ''git stash'' that saves any uncommitted (no need to stage them) files without actually committing them. You can then switch to a different branch, or do anything else you like. When you are ready to carry on go back to the branch (actually it doesn''t have to be the same branch if you realised you were working on the wrong one) and use ''git stash apply'' to get your work back. 2009/3/16 Davi Vidal <davividal-UiHwsRqXctc1RhZgQKG/ig@public.gmane.org>> > On 03/16/2009 04:34 PM, Colin Law wrote: > > Did you remember to commit the new files before switching back to master? > > > > What if I can''t/don''t want to commit now? Should I stage my files? > > Thanks, > > davi > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
I''m not sure if you will be able to switch to old branch if you add new files to index, but if you cannot commit files you can use git stash. On the other hand you can commit them although you didn''t finish complete development since that commit will not disturb anything until you publish your changes with git push. After you finish development and perform series of commits to new branch you can squash your commits into single commit and that''s it. So there is no reason not to commit new files on the development branch. On Mar 16, 8:55 pm, Davi Vidal <davivi...-UiHwsRqXctc1RhZgQKG/ig@public.gmane.org> wrote:> On 03/16/2009 04:34 PM, Colin Law wrote: > > > Did you remember to commit the new files before switching back to master? > > What if I can''t/don''t want to commit now? Should I stage my files? > > Thanks, > > davi--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Colin Law wrote:> Did you remember to commit the new files before switching back to > master? > > 2009/3/16 Pål Bergström <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>Yes I did. I used > git commit -a -v -m "message" Then I did a checkout in order to returning to master branch. -- 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Pål Bergström wrote:> > Yes I did. I used > git commit -a -v -m "message" > > Then I did a checkout in order to returning to master branch.Sorry. Seems to work now. My bad. Must have been the cache function of the server, which is a bit problematic in LiteSpeed Web Server (but otherwise a great server). -- 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On 03/16/2009 05:10 PM, Bosko Ivanisevic wrote:> (...) On the other hand you can commit them (...) since that commit will> not disturb anything until you publish your changes with git push. (...)> (...) So there is no reason not to commit new files on the development branch. >Yeah. I know. :-) Just a simple doubt that occurred to me. :-) But thank you very much, Colin and Bosko. davi --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---