You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flex.apache.org by Gordon Smith <go...@adobe.com> on 2013/03/18 18:52:49 UTC

I'm confused about local vs. remote branches

I've cloned the flex-sdk repo. When I do 'git branch' all I see is

* master

but when I do 'git branch -a' I see

* master
remotes/origin/HEAD -> origin/master
remotes/origin/develop
remotes/origin/patches
remotes/origin/release4.9

I'm not clear on how to read this, but it looks like the remote repo has a develop branch but my local repo doesn't. Does that mean I can't do 'git checkout develop'?

- Gordon


Re: I'm confused about local vs. remote branches

Posted by Dasa Paddock <dp...@esri.com>.
-p or --prune will "remove any remote-tracking branches which no longer exist on the remote" [1]

This just helps to keep your clone in sync with the remote.

[1]: http://git-scm.com/docs/git-fetch

--Dasa

On Mar 18, 2013, at 5:09 PM, Justin Mclean <ju...@classsoftware.com>
 wrote:

> Hi,
> 
>> git fetch - prune
> 
> Why the -prune option? And what if any are the issues if you don't do this?
> 
> Justin
> 


Re: I'm confused about local vs. remote branches

Posted by Justin Mclean <ju...@classsoftware.com>.
Hi,

> git fetch - prune

Why the -prune option? And what if any are the issues if you don't do this?

Justin

Re: I'm confused about local vs. remote branches

Posted by Jose Barragan <jo...@codeoscopic.com>.
Ok Gordon, 
I will try to explain to you how it works, I hope to do :)..

When cloning a GIT repository, what you get is just that, a complete clone the remote repository. Well, GIT shows you how local branches that are available for use in your working copy, and as remote, which represent the branches that are in the remote repository.

To keep in sync with remote branches actual remote content, need to run:
git fetch - prune
This causes your repository in the remote space representation is Synchronize with the actual remote repository, without altering your pointer at the local branches.

When you run:
ie.: git checkout develop 
what you get is a change from branch to "Develop" and should not have this branch represented in your local area, a local entry is created for it, so you can have a life cycle of its namesake separate remote.

In short, in your life cycle, you need to keep your local repository synchronized (your clone) against the remote, and secondly, the working branch running:
git pull

Remember that both commits, as the branches are characterized as pointers to the index, and therefore are very light and easy to apply.

I hope it clears, and not complicate the issue further.

Best,
--
Jose Barragan
Chief Software Architect
Codeoscopic Madrid
C/. Infanta Mercedes, 92. 
Planta 5.  505.
28020 Madrid.
Tel.: +34 912 94 80 80

On Mar 18, 2013, at 6:52 PM, Gordon Smith <go...@adobe.com> wrote:

> I've cloned the flex-sdk repo. When I do 'git branch' all I see is
> 
> * master
> 
> but when I do 'git branch -a' I see
> 
> * master
> remotes/origin/HEAD -> origin/master
> remotes/origin/develop
> remotes/origin/patches
> remotes/origin/release4.9
> 
> I'm not clear on how to read this, but it looks like the remote repo has a develop branch but my local repo doesn't. Does that mean I can't do 'git checkout develop'?
> 
> - Gordon
> 


Re: I'm confused about local vs. remote branches

Posted by Dasa Paddock <dp...@esri.com>.
Only the current branch.

http://git-scm.com/docs/git-pull

--Dasa

On Mar 18, 2013, at 11:21 AM, Gordon Smith <go...@adobe.com>> wrote:

So now that I have two local branches, will 'git pull' update both of them, or only the current branch?


Re: I'm confused about local vs. remote branches

Posted by Frédéric THOMAS <we...@hotmail.com>.
use git branch --all to see local and remote branches, local branches are 
created at checkout time.

-Fred

-----Message d'origine----- 
From: Gordon Smith
Sent: Monday, March 18, 2013 7:21 PM
To: dev@flex.apache.org
Subject: RE: I'm confused about local vs. remote branches

You seem to be right. I tried 'git checkout develop' and it switched to that 
branch. Afterwards 'git branch' showed

*develop
master

So now that I have two local branches, will 'git pull' update both of them, 
or only the current branch?

- Gordon

-----Original Message-----
From: Erik de Bruin [mailto:erik@ixsoftware.nl]
Sent: Monday, March 18, 2013 11:00 AM
To: dev@flex.apache.org
Subject: Re: I'm confused about local vs. remote branches

The way I understand it, if you do "git checkout develop", it will give you 
a local copy of the develop branch that tracks 'origin/develop'… but I'm 
also just learning git, so please correct me if I'm explaining this wrong.


EdB



--
Ix Multimedia Software

Jan Luykenstraat 27
3521 VB Utrecht

T. 06-51952295
I. www.ixsoftware.nl (http://www.ixsoftware.nl)



On Monday, March 18, 2013 at 18:52, Gordon Smith wrote:

> I've cloned the flex-sdk repo. When I do 'git branch' all I see is
>
> * master
>
> but when I do 'git branch -a' I see
>
> * master
> remotes/origin/HEAD -> origin/master
> remotes/origin/develop
> remotes/origin/patches
> remotes/origin/release4.9
>
> I'm not clear on how to read this, but it looks like the remote repo has a 
> develop branch but my local repo doesn't. Does that mean I can't do 'git 
> checkout develop'?
>
> - Gordon



RE: I'm confused about local vs. remote branches

Posted by Gordon Smith <go...@adobe.com>.
You seem to be right. I tried 'git checkout develop' and it switched to that branch. Afterwards 'git branch' showed

*develop
master

So now that I have two local branches, will 'git pull' update both of them, or only the current branch?

- Gordon

-----Original Message-----
From: Erik de Bruin [mailto:erik@ixsoftware.nl] 
Sent: Monday, March 18, 2013 11:00 AM
To: dev@flex.apache.org
Subject: Re: I'm confused about local vs. remote branches

The way I understand it, if you do "git checkout develop", it will give you a local copy of the develop branch that tracks 'origin/develop'… but I'm also just learning git, so please correct me if I'm explaining this wrong.


EdB



--
Ix Multimedia Software

Jan Luykenstraat 27
3521 VB Utrecht

T. 06-51952295
I. www.ixsoftware.nl (http://www.ixsoftware.nl)



On Monday, March 18, 2013 at 18:52, Gordon Smith wrote:

> I've cloned the flex-sdk repo. When I do 'git branch' all I see is
>  
> * master
>  
> but when I do 'git branch -a' I see
>  
> * master
> remotes/origin/HEAD -> origin/master
> remotes/origin/develop
> remotes/origin/patches
> remotes/origin/release4.9
>  
> I'm not clear on how to read this, but it looks like the remote repo has a develop branch but my local repo doesn't. Does that mean I can't do 'git checkout develop'?
>  
> - Gordon  



Re: I'm confused about local vs. remote branches

Posted by Erik de Bruin <er...@ixsoftware.nl>.
The way I understand it, if you do "git checkout develop", it will give you a local copy of the develop branch that tracks 'origin/develop'… but I'm also just learning git, so please correct me if I'm explaining this wrong.


EdB



--
Ix Multimedia Software

Jan Luykenstraat 27
3521 VB Utrecht

T. 06-51952295
I. www.ixsoftware.nl (http://www.ixsoftware.nl)



On Monday, March 18, 2013 at 18:52, Gordon Smith wrote:

> I've cloned the flex-sdk repo. When I do 'git branch' all I see is
>  
> * master
>  
> but when I do 'git branch -a' I see
>  
> * master
> remotes/origin/HEAD -> origin/master
> remotes/origin/develop
> remotes/origin/patches
> remotes/origin/release4.9
>  
> I'm not clear on how to read this, but it looks like the remote repo has a develop branch but my local repo doesn't. Does that mean I can't do 'git checkout develop'?
>  
> - Gordon