{"thread":{"id":"20939","subject":"Tracking remote branches","startedAt":"2009-09-14T00:37:26Z","lastAt":"2009-09-14T19:19:58Z","messageCount":4,"participants":["Thiago Farina","Nicolas Sebrecht","Heiko Voigt"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"123127","messageId":"a4c8a6d00909131737v35d7c63dsea669f47456f5acb@mail.gmail.com","threadId":"20939","inReplyTo":null,"subject":"Tracking remote branches","fromName":"Thiago Farina","fromEmail":"tfransosi@gmail.com","sentAt":"2009-09-14T00:37:26Z","receivedAt":"2009-09-14T00:37:26Z","isPatch":false,"sender":{"key":"tfransosi@gmail.com","avatar":"https://avatars.githubusercontent.com/u/970071?v=4"},"body":"Hi,\n\nI'm not understanding what is happening here. I tried to track a\nremote branch, origin/maint from git. So I did:\n$ git branch --track maint origin/maint\n$ git checkout maint\n\nI know that I could do simply, instead of above:\n$ git checkout --track -b maint origin/maint\n\nOK, now I switched to maint branch. And then I did:\n$ git status\n\n# On branch maint\n# Changes to be committed\n#    (use \"git reset HEAD <file>...\" to unstage)\n#\n#          new file:    git-remote-curl\n#          new file:    git-replace\n#\n\nWhat happened here? What I have to do now?\n"},{"id":"123132","messageId":"20090914050145.GA12985@vidovic","threadId":"20939","inReplyTo":"a4c8a6d00909131737v35d7c63dsea669f47456f5acb@mail.gmail.com","subject":"Re: Tracking remote branches","fromName":"Nicolas Sebrecht","fromEmail":"nicolas.s.dev@gmx.fr","sentAt":"2009-09-14T05:01:45Z","receivedAt":"2009-09-14T05:01:45Z","isPatch":false,"sender":{"key":"nicolas.s.dev@gmx.fr","avatar":null},"body":"The 13/09/09, Thiago Farina wrote:\n> Hi,\n> \n> I know that I could do simply, instead of above:\n> $ git checkout --track -b maint origin/maint\n\nOr\n$ git checkout -t origin/maint\n\n> OK, now I switched to maint branch. And then I did:\n> $ git status\n> \n> # On branch maint\n> # Changes to be committed\n> #    (use \"git reset HEAD <file>...\" to unstage)\n> #\n> #          new file:    git-remote-curl\n> #          new file:    git-replace\n> #\n> \n> What happened here? What I have to do now?\n\nYou've probably added these files to the index, mistakenly. If you don't\nhave uncommited changes, try :\n\n  git checkout -f master\n  git branch -D maint\n  git checkout -t origin/maint\n  git status\n\nThe files should now be shown as \"Untracked files\".\n\n-- \nNicolas Sebrecht\n"},{"id":"123182","messageId":"a4c8a6d00909141130o628a069fu4c489b25f95f543d@mail.gmail.com","threadId":"20939","inReplyTo":"20090914050145.GA12985@vidovic","subject":"Re: Tracking remote branches","fromName":"Thiago Farina","fromEmail":"tfransosi@gmail.com","sentAt":"2009-09-14T18:30:10Z","receivedAt":"2009-09-14T18:30:10Z","isPatch":false,"sender":{"key":"tfransosi@gmail.com","avatar":"https://avatars.githubusercontent.com/u/970071?v=4"},"body":"On Mon, Sep 14, 2009 at 2:01 AM, Nicolas Sebrecht <nicolas.s.dev@gmx.fr> wrote:\n> The 13/09/09, Thiago Farina wrote:\n>> Hi,\n>>\n>> I know that I could do simply, instead of above:\n>> $ git checkout --track -b maint origin/maint\n>\n> Or\n> $ git checkout -t origin/maint\n>\n>> OK, now I switched to maint branch. And then I did:\n>> $ git status\n>>\n>> # On branch maint\n>> # Changes to be committed\n>> #    (use \"git reset HEAD <file>...\" to unstage)\n>> #\n>> #          new file:    git-remote-curl\n>> #          new file:    git-replace\n>> #\n>>\n>> What happened here? What I have to do now?\n>\n> You've probably added these files to the index, mistakenly. If you don't\n> have uncommited changes, try :\n>\n>  git checkout -f master\n>  git branch -D maint\n>  git checkout -t origin/maint\n>  git status\n>\n> The files should now be shown as \"Untracked files\".\nYeah, now the files has this status. But I don't have anything related\nwith these files, I didn't add these files.\nWhy these files has this status? Is supposed to me to do something\nabout that when this situation occurs?\n"},{"id":"123188","messageId":"20090914191957.GB64280@macbook.lan","threadId":"20939","inReplyTo":"a4c8a6d00909141130o628a069fu4c489b25f95f543d@mail.gmail.com","subject":"Re: Re: Tracking remote branches","fromName":"Heiko Voigt","fromEmail":"hvoigt@hvoigt.net","sentAt":"2009-09-14T19:19:58Z","receivedAt":"2009-09-14T19:19:58Z","isPatch":false,"sender":{"key":"hvoigt@hvoigt.net","avatar":"https://avatars.githubusercontent.com/u/184958?v=4"},"body":"On Mon, Sep 14, 2009 at 03:30:10PM -0300, Thiago Farina wrote:\n> On Mon, Sep 14, 2009 at 2:01 AM, Nicolas Sebrecht <nicolas.s.dev@gmx.fr> wrote:\n> > The 13/09/09, Thiago Farina wrote:\n> > $ git checkout -t origin/maint\n> >\n> >> OK, now I switched to maint branch. And then I did:\n> >> $ git status\n> >>\n> >> # On branch maint\n> >> # Changes to be committed\n> >> #    (use \"git reset HEAD <file>...\" to unstage)\n> >> #\n> >> #          new file:    git-remote-curl\n> >> #          new file:    git-replace\n> >> #\n> >>\n> >> What happened here? What I have to do now?\n>\n> Why these files has this status? Is supposed to me to do something\n> about that when this situation occurs?\n\nI just checked and this is because you probably made a build on the\nmaster branch which creates these files. They are untracked but ignored\nthrough the .gitignore file in the master branch.\n\nNow the situation is that the .gitignore on the current 'maint' branch\ndoes not have these files ignored because they are quite new.\n\nIn this situation you can do a\n\n  git clean -f\n\nwhich gets rid of all untracked but not ignored files (all files that\ngit status shows as new) or\n\n  make clean\n\nwhile you are still on the master branch.\n\ncheers Heiko\n"}]}