All of lore.kernel.org
 help / color / mirror / Atom feed
* Tracking remote branches
@ 2009-09-14  0:37 Thiago Farina
  2009-09-14  5:01 ` Nicolas Sebrecht
  0 siblings, 1 reply; 4+ messages in thread
From: Thiago Farina @ 2009-09-14  0:37 UTC (permalink / raw)
  To: git

Hi,

I'm not understanding what is happening here. I tried to track a
remote branch, origin/maint from git. So I did:
$ git branch --track maint origin/maint
$ git checkout maint

I know that I could do simply, instead of above:
$ git checkout --track -b maint origin/maint

OK, now I switched to maint branch. And then I did:
$ git status

# On branch maint
# Changes to be committed
#    (use "git reset HEAD <file>..." to unstage)
#
#          new file:    git-remote-curl
#          new file:    git-replace
#

What happened here? What I have to do now?

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Tracking remote branches
  2009-09-14  0:37 Tracking remote branches Thiago Farina
@ 2009-09-14  5:01 ` Nicolas Sebrecht
  2009-09-14 18:30   ` Thiago Farina
  0 siblings, 1 reply; 4+ messages in thread
From: Nicolas Sebrecht @ 2009-09-14  5:01 UTC (permalink / raw)
  To: Thiago Farina; +Cc: git

The 13/09/09, Thiago Farina wrote:
> Hi,
> 
> I know that I could do simply, instead of above:
> $ git checkout --track -b maint origin/maint

Or
$ git checkout -t origin/maint

> OK, now I switched to maint branch. And then I did:
> $ git status
> 
> # On branch maint
> # Changes to be committed
> #    (use "git reset HEAD <file>..." to unstage)
> #
> #          new file:    git-remote-curl
> #          new file:    git-replace
> #
> 
> What happened here? What I have to do now?

You've probably added these files to the index, mistakenly. If you don't
have uncommited changes, try :

  git checkout -f master
  git branch -D maint
  git checkout -t origin/maint
  git status

The files should now be shown as "Untracked files".

-- 
Nicolas Sebrecht

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Tracking remote branches
  2009-09-14  5:01 ` Nicolas Sebrecht
@ 2009-09-14 18:30   ` Thiago Farina
  2009-09-14 19:19     ` Heiko Voigt
  0 siblings, 1 reply; 4+ messages in thread
From: Thiago Farina @ 2009-09-14 18:30 UTC (permalink / raw)
  To: Nicolas Sebrecht; +Cc: git

On Mon, Sep 14, 2009 at 2:01 AM, Nicolas Sebrecht <nicolas.s.dev@gmx.fr> wrote:
> The 13/09/09, Thiago Farina wrote:
>> Hi,
>>
>> I know that I could do simply, instead of above:
>> $ git checkout --track -b maint origin/maint
>
> Or
> $ git checkout -t origin/maint
>
>> OK, now I switched to maint branch. And then I did:
>> $ git status
>>
>> # On branch maint
>> # Changes to be committed
>> #    (use "git reset HEAD <file>..." to unstage)
>> #
>> #          new file:    git-remote-curl
>> #          new file:    git-replace
>> #
>>
>> What happened here? What I have to do now?
>
> You've probably added these files to the index, mistakenly. If you don't
> have uncommited changes, try :
>
>  git checkout -f master
>  git branch -D maint
>  git checkout -t origin/maint
>  git status
>
> The files should now be shown as "Untracked files".
Yeah, now the files has this status. But I don't have anything related
with these files, I didn't add these files.
Why these files has this status? Is supposed to me to do something
about that when this situation occurs?

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Re: Tracking remote branches
  2009-09-14 18:30   ` Thiago Farina
@ 2009-09-14 19:19     ` Heiko Voigt
  0 siblings, 0 replies; 4+ messages in thread
From: Heiko Voigt @ 2009-09-14 19:19 UTC (permalink / raw)
  To: Thiago Farina; +Cc: Nicolas Sebrecht, git

On Mon, Sep 14, 2009 at 03:30:10PM -0300, Thiago Farina wrote:
> On Mon, Sep 14, 2009 at 2:01 AM, Nicolas Sebrecht <nicolas.s.dev@gmx.fr> wrote:
> > The 13/09/09, Thiago Farina wrote:
> > $ git checkout -t origin/maint
> >
> >> OK, now I switched to maint branch. And then I did:
> >> $ git status
> >>
> >> # On branch maint
> >> # Changes to be committed
> >> #    (use "git reset HEAD <file>..." to unstage)
> >> #
> >> #          new file:    git-remote-curl
> >> #          new file:    git-replace
> >> #
> >>
> >> What happened here? What I have to do now?
>
> Why these files has this status? Is supposed to me to do something
> about that when this situation occurs?

I just checked and this is because you probably made a build on the
master branch which creates these files. They are untracked but ignored
through the .gitignore file in the master branch.

Now the situation is that the .gitignore on the current 'maint' branch
does not have these files ignored because they are quite new.

In this situation you can do a

  git clean -f

which gets rid of all untracked but not ignored files (all files that
git status shows as new) or

  make clean

while you are still on the master branch.

cheers Heiko

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-09-14 19:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-09-14  0:37 Tracking remote branches Thiago Farina
2009-09-14  5:01 ` Nicolas Sebrecht
2009-09-14 18:30   ` Thiago Farina
2009-09-14 19:19     ` Heiko Voigt

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.