git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* how do I create a branch and push it so several developers can share work?
@ 2010-09-08 22:31 Robert Buck
  2010-09-08 22:40 ` Jacob Helwig
  0 siblings, 1 reply; 4+ messages in thread
From: Robert Buck @ 2010-09-08 22:31 UTC (permalink / raw)
  To: git@vger.kernel.org List

We just switched over to git and also use gitolite.

To create a new branch and push it so a team of developers can
collaborate on that branch I performed the following commands:

Listed available tags:
git fetch --tags

Listed available branches, which for me only showed one, master:
git branch

Created the branch off the tag:
git branch fullers tagduvel

Checked out the branch to verify the contents:
git checkout fullers
...

Push the branch to the remote repository:
git push origin fullers

Now, when I clone the repository and list the branches I only see
'master'. If I list the branches with the -a option I see something I
did not anticipate:
git branch -a
* master
  remotes/origin/HEAD -> origin/master
  remotes/origin/duvel
  remotes/origin/fullers
  remotes/origin/master

What I had expected was a fullers branch.

So apparently I did something very wrong here. What did I do wrong?

Thanks,

Bob

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

* Re: how do I create a branch and push it so several developers can share work?
  2010-09-08 22:31 how do I create a branch and push it so several developers can share work? Robert Buck
@ 2010-09-08 22:40 ` Jacob Helwig
  2010-09-08 23:01   ` Robert Buck
  0 siblings, 1 reply; 4+ messages in thread
From: Jacob Helwig @ 2010-09-08 22:40 UTC (permalink / raw)
  To: Robert Buck; +Cc: git@vger.kernel.org List

[-- Attachment #1: Type: text/plain, Size: 1610 bytes --]

On Wed, 08 Sep 2010 18:31:30 -0400, Robert Buck wrote:
> 
> We just switched over to git and also use gitolite.
> 
> To create a new branch and push it so a team of developers can
> collaborate on that branch I performed the following commands:
> 
> Listed available tags:
> git fetch --tags
> 
> Listed available branches, which for me only showed one, master:
> git branch
> 
> Created the branch off the tag:
> git branch fullers tagduvel
> 
> Checked out the branch to verify the contents:
> git checkout fullers
> ...
> 
> Push the branch to the remote repository:
> git push origin fullers
> 
> Now, when I clone the repository and list the branches I only see
> 'master'. If I list the branches with the -a option I see something I
> did not anticipate:
> git branch -a
> * master
>   remotes/origin/HEAD -> origin/master
>   remotes/origin/duvel
>   remotes/origin/fullers
>   remotes/origin/master
> 
> What I had expected was a fullers branch.
> 
> So apparently I did something very wrong here. What did I do wrong?
> 
> Thanks,
> 
> Bob

You didn't do anything wrong at all.  That's exactly what I'd expect to
see at the end.  Git doesn't automatically create local branches (the
ones without remotes/.../ in front) for any branches other than the one
pointed to by remotes/origin/HEAD.

The other developers will still have your fullers branch available to
them, but if they want to do any work on it, they'll need to do
something like "git checkout -b fullers origin/fullers" to create a
local branch, which they can modify.

-- 
Jacob Helwig

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 665 bytes --]

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

* Re: how do I create a branch and push it so several developers can share work?
  2010-09-08 22:40 ` Jacob Helwig
@ 2010-09-08 23:01   ` Robert Buck
  2010-09-09  5:36     ` Miles Bader
  0 siblings, 1 reply; 4+ messages in thread
From: Robert Buck @ 2010-09-08 23:01 UTC (permalink / raw)
  To: Jacob Helwig; +Cc: git@vger.kernel.org List

Thanks Jacob. I thought I had done it right, but when I cloned and did
not get what I expected at first, I was a bit concerned. Thanks.

Related question, is there a way to have fullers show up automatically
as a local branch for developers simply through a `git clone`?



On Wed, Sep 8, 2010 at 6:40 PM, Jacob Helwig <jacob.helwig@gmail.com> wrote:
> On Wed, 08 Sep 2010 18:31:30 -0400, Robert Buck wrote:
>>
>> We just switched over to git and also use gitolite.
>>
>> To create a new branch and push it so a team of developers can
>> collaborate on that branch I performed the following commands:
>>
>> Listed available tags:
>> git fetch --tags
>>
>> Listed available branches, which for me only showed one, master:
>> git branch
>>
>> Created the branch off the tag:
>> git branch fullers tagduvel
>>
>> Checked out the branch to verify the contents:
>> git checkout fullers
>> ...
>>
>> Push the branch to the remote repository:
>> git push origin fullers
>>
>> Now, when I clone the repository and list the branches I only see
>> 'master'. If I list the branches with the -a option I see something I
>> did not anticipate:
>> git branch -a
>> * master
>>   remotes/origin/HEAD -> origin/master
>>   remotes/origin/duvel
>>   remotes/origin/fullers
>>   remotes/origin/master
>>
>> What I had expected was a fullers branch.
>>
>> So apparently I did something very wrong here. What did I do wrong?
>>
>> Thanks,
>>
>> Bob
>
> You didn't do anything wrong at all.  That's exactly what I'd expect to
> see at the end.  Git doesn't automatically create local branches (the
> ones without remotes/.../ in front) for any branches other than the one
> pointed to by remotes/origin/HEAD.
>
> The other developers will still have your fullers branch available to
> them, but if they want to do any work on it, they'll need to do
> something like "git checkout -b fullers origin/fullers" to create a
> local branch, which they can modify.
>
> --
> Jacob Helwig
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.10 (GNU/Linux)
>
> iQGcBAEBAgAGBQJMiBDiAAoJEHJabXWGiqEBu1cL+gNCu5BiRFytPSi7IsjPNk81
> dPO6AX69K1hq22eShO0Li62NPDhM4B8H5aXAlfdtjVLz/VdRrAiuBaW2zX0eUaQ6
> i7k3vl+QeyDt02UphG9mM8dEYivrh7UUozQ3OVTYitkN5+3kmfg7tw+7pF7+Z6Et
> LZ7bRUb3pzEaD8sKSKNbqjSpj9bqo2aCdgZFd+fE8yzNDmpE6wQby9vks15IOtPd
> Skh+SjhmD9yNL6LC3+8989muxXomi2gZvXIcCyBy/ECexeLSTOQGH6JX086TIqus
> rVKn7UNNncNzB2Q/lY8VM89A7zTyEdFhIbh8xkbEEGPGkGTU3t/TOwANGU0Q3rRO
> ymNJYLhg9cg+JWnO04f5gTPI66df4J16ctqIEWqBiqK6gm+8/VlLyz2H4yIvxRfW
> zocPp3ae/JsKIYKAqBPwFaeNgW4mHMmLlnv6Gc96ZscFE66dj5HgwuY80B6pNSqR
> U3H3VJGWNJsAceByhArsaytrzLURbxqpE4a79IuVIg==
> =fj56
> -----END PGP SIGNATURE-----
>
>

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

* Re: how do I create a branch and push it so several developers can share work?
  2010-09-08 23:01   ` Robert Buck
@ 2010-09-09  5:36     ` Miles Bader
  0 siblings, 0 replies; 4+ messages in thread
From: Miles Bader @ 2010-09-09  5:36 UTC (permalink / raw)
  To: Robert Buck; +Cc: Jacob Helwig, git@vger.kernel.org List

Robert Buck <buck.robert.j@gmail.com> writes:
> Related question, is there a way to have fullers show up automatically
> as a local branch for developers simply through a `git clone`?

Hm, can't you have them do "git clone --branch fullers REMOTE" ?

I thinnnnnk that does the right thing (does the clone, then makes a
local "fullers" branch that tracks the remote "fullers" branch).

AFAIK there's no way to get multiple new local branches though
(e.g. master _and_ fullers)...

-Miles

-- 
(\(\
(^.^)
(")")
*This is the cute bunny virus, please copy this into your sig so it can spread.

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

end of thread, other threads:[~2010-09-09  5:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-08 22:31 how do I create a branch and push it so several developers can share work? Robert Buck
2010-09-08 22:40 ` Jacob Helwig
2010-09-08 23:01   ` Robert Buck
2010-09-09  5:36     ` Miles Bader

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).