git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Local branch to remote branch translation
@ 2007-11-11 17:54 Jon Smirl
  2007-11-11 18:02 ` Jon Smirl
  0 siblings, 1 reply; 10+ messages in thread
From: Jon Smirl @ 2007-11-11 17:54 UTC (permalink / raw)
  To: Git Mailing List

What am I doing wrong in this sequence?

In my local repo I have two remotes:

jonsmirl@terra:~/mpc5200b$ git remote
dreamhost
linus

I create branches off from these using:
git branch -b m29 linus/master

I update them with
stg rebase linus/master

My repo has a .git/packed-refs file

When I push this repo to a remote server my local branches get renamed.

jonsmirl@terra:~/mpc5200b$ git push dreamhost
To ssh://jonsmirl1@git.digispeaker.com/~/mpc5200b.git
 * [new branch]      m24 -> linus/m24
 * [new branch]      m25 -> linus/m25
 * [new branch]      m26 -> linus/m26
 * [new branch]      m28 -> linus/m28
 * [new branch]      m29 -> linus/m29
Counting objects: 619084, done.
...

So one the remote server I see this:

[daedalus]$ git remote
[daedalus]$ git branch
[daedalus]$ git branch -r
  linus/m24
  linus/m25
  linus/m26
  linus/m28
  linus/m29
[daedalus]$

With the repo in this state at the remote server gitweb thinks the
repo is empty.
Why are these branches getting renamed?

git head is in use on both ends.

-- 
Jon Smirl
jonsmirl@gmail.com

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

* Re: Local branch to remote branch translation
  2007-11-11 17:54 Local branch to remote branch translation Jon Smirl
@ 2007-11-11 18:02 ` Jon Smirl
  2007-11-11 18:19   ` Steffen Prohaska
  0 siblings, 1 reply; 10+ messages in thread
From: Jon Smirl @ 2007-11-11 18:02 UTC (permalink / raw)
  To: Git Mailing List

Is the remote config not correct?

[remote "dreamhost"]
        url = ssh://jonsmirl1@git.digispeaker.com/~/mpc5200b.git
        fetch = +refs/heads/*:refs/remotes/dreamhost/*
        push = +refs/heads/*:refs/remotes/linus/*


-- 
Jon Smirl
jonsmirl@gmail.com

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

* Re: Local branch to remote branch translation
  2007-11-11 18:02 ` Jon Smirl
@ 2007-11-11 18:19   ` Steffen Prohaska
  2007-11-11 19:36     ` Jon Smirl
  0 siblings, 1 reply; 10+ messages in thread
From: Steffen Prohaska @ 2007-11-11 18:19 UTC (permalink / raw)
  To: Jon Smirl; +Cc: Git Mailing List


On Nov 11, 2007, at 7:02 PM, Jon Smirl wrote:

> Is the remote config not correct?

This is the configuration for remote "dreamhost". In your
previous mail you also mentioned a remote "linus". But
this seems to be unrelated to your question.


> [remote "dreamhost"]
>         url = ssh://jonsmirl1@git.digispeaker.com/~/mpc5200b.git
>         fetch = +refs/heads/*:refs/remotes/dreamhost/*

correct. This fetches the branches from the remote and stores
them locally as remote tracking branches "dreamhost/<branch>".

>         push = +refs/heads/*:refs/remotes/linus/*

This "renames" your branches when you push. Your local branches
get pushed to "dreamhost" and are stored there as remote branches
"linus/<branch>". From your previous mail I assume you like to store
them as normal branches. You'd need to say

	push = +refs/heads/*:refs/heads/*

But most likely you don't want to force here, that is drop '+'.
And you don't need to explicitly say that you want to store a branch
under the same name. So, probably you want

	push = refs/heads/*

But maybe you could even drop the push line completely. Then, only
existing branches would be pushed and if you want to create a new
remote branch on "dreamhost" you'd need to explicitly tell git with

	git push dreamhost <new-branch>

Does this help?
	
	Steffen

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

* Re: Local branch to remote branch translation
  2007-11-11 18:19   ` Steffen Prohaska
@ 2007-11-11 19:36     ` Jon Smirl
  2007-11-11 20:59       ` Steffen Prohaska
  0 siblings, 1 reply; 10+ messages in thread
From: Jon Smirl @ 2007-11-11 19:36 UTC (permalink / raw)
  To: Steffen Prohaska; +Cc: Git Mailing List

On 11/11/07, Steffen Prohaska <prohaska@zib.de> wrote:
>
> On Nov 11, 2007, at 7:02 PM, Jon Smirl wrote:
>
> > Is the remote config not correct?
>
> This is the configuration for remote "dreamhost". In your
> previous mail you also mentioned a remote "linus". But
> this seems to be unrelated to your question.
>
>
> > [remote "dreamhost"]
> >         url = ssh://jonsmirl1@git.digispeaker.com/~/mpc5200b.git
> >         fetch = +refs/heads/*:refs/remotes/dreamhost/*
>
> correct. This fetches the branches from the remote and stores
> them locally as remote tracking branches "dreamhost/<branch>".
>
> >         push = +refs/heads/*:refs/remotes/linus/*
>
> This "renames" your branches when you push. Your local branches
> get pushed to "dreamhost" and are stored there as remote branches
> "linus/<branch>". From your previous mail I assume you like to store
> them as normal branches. You'd need to say

I did this part incorrectly. I was trying to push my local definition
of the linus remote to the dreamhost repo so that when someone clones
dreamhost linus would be defined in their repo.

jonsmirl@terra:~/mpc5200b$ git remote show linus
* remote linus
  URL: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git

How do I push the definition of the linus remote repo?


>
>         push = +refs/heads/*:refs/heads/*
>
> But most likely you don't want to force here, that is drop '+'.
> And you don't need to explicitly say that you want to store a branch
> under the same name. So, probably you want
>
>         push = refs/heads/*
>
> But maybe you could even drop the push line completely. Then, only
> existing branches would be pushed and if you want to create a new
> remote branch on "dreamhost" you'd need to explicitly tell git with
>
>         git push dreamhost <new-branch>
>
> Does this help?
>
>         Steffen
>


-- 
Jon Smirl
jonsmirl@gmail.com

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

* Re: Local branch to remote branch translation
  2007-11-11 19:36     ` Jon Smirl
@ 2007-11-11 20:59       ` Steffen Prohaska
  2007-11-11 21:20         ` Jon Smirl
  0 siblings, 1 reply; 10+ messages in thread
From: Steffen Prohaska @ 2007-11-11 20:59 UTC (permalink / raw)
  To: Jon Smirl; +Cc: Git Mailing List


On Nov 11, 2007, at 8:36 PM, Jon Smirl wrote:

> On 11/11/07, Steffen Prohaska <prohaska@zib.de> wrote:
>>
>> On Nov 11, 2007, at 7:02 PM, Jon Smirl wrote:
>>
>>> Is the remote config not correct?
>>
>> This is the configuration for remote "dreamhost". In your
>> previous mail you also mentioned a remote "linus". But
>> this seems to be unrelated to your question.
>>
>>
>>> [remote "dreamhost"]
>>>         url = ssh://jonsmirl1@git.digispeaker.com/~/mpc5200b.git
>>>         fetch = +refs/heads/*:refs/remotes/dreamhost/*
>>
>> correct. This fetches the branches from the remote and stores
>> them locally as remote tracking branches "dreamhost/<branch>".
>>
>>>         push = +refs/heads/*:refs/remotes/linus/*
>>
>> This "renames" your branches when you push. Your local branches
>> get pushed to "dreamhost" and are stored there as remote branches
>> "linus/<branch>". From your previous mail I assume you like to store
>> them as normal branches. You'd need to say
>
> I did this part incorrectly. I was trying to push my local definition
> of the linus remote to the dreamhost repo so that when someone clones
> dreamhost linus would be defined in their repo.
>
> jonsmirl@terra:~/mpc5200b$ git remote show linus
> * remote linus
>   URL: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/ 
> linux-2.6.git
>
> How do I push the definition of the linus remote repo?

You can't. Remotes are local to a repository. They cannot be
"pushed" nor will they be "cloned" or "fetched".

	Steffen

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

* Re: Local branch to remote branch translation
  2007-11-11 20:59       ` Steffen Prohaska
@ 2007-11-11 21:20         ` Jon Smirl
  2007-11-11 22:01           ` Steffen Prohaska
  0 siblings, 1 reply; 10+ messages in thread
From: Jon Smirl @ 2007-11-11 21:20 UTC (permalink / raw)
  To: Steffen Prohaska; +Cc: Git Mailing List

On 11/11/07, Steffen Prohaska <prohaska@zib.de> wrote:
> > jonsmirl@terra:~/mpc5200b$ git remote show linus
> > * remote linus
> >   URL: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/
> > linux-2.6.git
> >
> > How do I push the definition of the linus remote repo?
>
> You can't. Remotes are local to a repository. They cannot be
> "pushed" nor will they be "cloned" or "fetched".

Dreamhost is way slow compared to kernel.org, so it is better to clone
from kernel.org first and then pull from dreamhost. What is the right
sequence of commands so that a new user will end up with a kernel they
can use 'git pull' on to get updates from dreamhost? I'll add these to
the repo description page.

I'm trying this locally and I can't figure out the right sequence of
git command to redirect origin from kernel.org to dreamhost.

Doing this was bad, it messed up my heads.
jonsmirl@terra:~/foo/digispeaker$ git remote rm origin
error: unable to resolve reference refs/remotes/origin/master: No such
file or directory
update-ref -d refs/remotes/origin/master
6e800af233e0bdf108efb7bd23c11ea6fa34cdeb: command returned error: 1

-- 
Jon Smirl
jonsmirl@gmail.com

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

* Re: Local branch to remote branch translation
  2007-11-11 21:20         ` Jon Smirl
@ 2007-11-11 22:01           ` Steffen Prohaska
  2007-11-11 22:46             ` Jon Smirl
  0 siblings, 1 reply; 10+ messages in thread
From: Steffen Prohaska @ 2007-11-11 22:01 UTC (permalink / raw)
  To: Jon Smirl; +Cc: Git Mailing List


On Nov 11, 2007, at 10:20 PM, Jon Smirl wrote:

> On 11/11/07, Steffen Prohaska <prohaska@zib.de> wrote:
>>> jonsmirl@terra:~/mpc5200b$ git remote show linus
>>> * remote linus
>>>   URL: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/
>>> linux-2.6.git
>>>
>>> How do I push the definition of the linus remote repo?
>>
>> You can't. Remotes are local to a repository. They cannot be
>> "pushed" nor will they be "cloned" or "fetched".
>
> Dreamhost is way slow compared to kernel.org, so it is better to clone
> from kernel.org first and then pull from dreamhost. What is the right
> sequence of commands so that a new user will end up with a kernel they
> can use 'git pull' on to get updates from dreamhost? I'll add these to
> the repo description page.
>
> I'm trying this locally and I can't figure out the right sequence of
> git command to redirect origin from kernel.org to dreamhost.

How about the following (untested sequence)

	mkdir linux-2.6
	cd linux-2.6
	git init
	git remote add linus git://git.kernel.org/pub/scm/linux/kernel/git/ 
torvalds/linux-2.6.git
	git remote add origin ssh://jonsmirl1@git.digispeaker.com/~/ 
mpc5200b.git
	git fetch linus
	git fetch origin
	git checkout -b master origin/master

The general idea should be correct. You have a non-standard
setup, so avoid git-clone.

	Steffen

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

* Re: Local branch to remote branch translation
  2007-11-11 22:01           ` Steffen Prohaska
@ 2007-11-11 22:46             ` Jon Smirl
  2007-11-12  6:25               ` Steffen Prohaska
  0 siblings, 1 reply; 10+ messages in thread
From: Jon Smirl @ 2007-11-11 22:46 UTC (permalink / raw)
  To: Steffen Prohaska; +Cc: Git Mailing List

On 11/11/07, Steffen Prohaska <prohaska@zib.de> wrote:
>
> On Nov 11, 2007, at 10:20 PM, Jon Smirl wrote:
>
> > On 11/11/07, Steffen Prohaska <prohaska@zib.de> wrote:
> >>> jonsmirl@terra:~/mpc5200b$ git remote show linus
> >>> * remote linus
> >>>   URL: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/
> >>> linux-2.6.git
> >>>
> >>> How do I push the definition of the linus remote repo?
> >>
> >> You can't. Remotes are local to a repository. They cannot be
> >> "pushed" nor will they be "cloned" or "fetched".
> >
> > Dreamhost is way slow compared to kernel.org, so it is better to clone
> > from kernel.org first and then pull from dreamhost. What is the right
> > sequence of commands so that a new user will end up with a kernel they
> > can use 'git pull' on to get updates from dreamhost? I'll add these to
> > the repo description page.
> >
> > I'm trying this locally and I can't figure out the right sequence of
> > git command to redirect origin from kernel.org to dreamhost.
>
> How about the following (untested sequence)
>
>         mkdir linux-2.6
>         cd linux-2.6
>         git init
>         git remote add linus git://git.kernel.org/pub/scm/linux/kernel/git/
> torvalds/linux-2.6.git
>         git remote add origin ssh://jonsmirl1@git.digispeaker.com/~/
> mpc5200b.git
>         git fetch linus
>         git fetch origin
>         git checkout -b master origin/master
>
> The general idea should be correct. You have a non-standard
> setup, so avoid git-clone.

What should I do to standardize the setup so that 'clone/pull' will
work on it? I created a master branch. I gave up on fighting with
gitweb and no branch named master.

I'd like to do this, but I can't figure out how.

git clone linus
move origin to digispeaker
git pull

There doesn't seem to be a simple way to redirect the origin.

-- 
Jon Smirl
jonsmirl@gmail.com

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

* Re: Local branch to remote branch translation
  2007-11-11 22:46             ` Jon Smirl
@ 2007-11-12  6:25               ` Steffen Prohaska
  2007-11-12 13:53                 ` Jon Smirl
  0 siblings, 1 reply; 10+ messages in thread
From: Steffen Prohaska @ 2007-11-12  6:25 UTC (permalink / raw)
  To: Jon Smirl; +Cc: Git Mailing List


On Nov 11, 2007, at 11:46 PM, Jon Smirl wrote:

> On 11/11/07, Steffen Prohaska <prohaska@zib.de> wrote:
>>
>> On Nov 11, 2007, at 10:20 PM, Jon Smirl wrote:
>>
>>> On 11/11/07, Steffen Prohaska <prohaska@zib.de> wrote:
>>>>> jonsmirl@terra:~/mpc5200b$ git remote show linus
>>>>> * remote linus
>>>>>   URL: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/
>>>>> linux-2.6.git
>>>>>
>>>>> How do I push the definition of the linus remote repo?
>>>>
>>>> You can't. Remotes are local to a repository. They cannot be
>>>> "pushed" nor will they be "cloned" or "fetched".
>>>
>>> Dreamhost is way slow compared to kernel.org, so it is better to  
>>> clone
>>> from kernel.org first and then pull from dreamhost. What is the  
>>> right
>>> sequence of commands so that a new user will end up with a kernel  
>>> they
>>> can use 'git pull' on to get updates from dreamhost? I'll add  
>>> these to
>>> the repo description page.
>>>
>>> I'm trying this locally and I can't figure out the right sequence of
>>> git command to redirect origin from kernel.org to dreamhost.
>>
>> How about the following (untested sequence)
>>
>>         mkdir linux-2.6
>>         cd linux-2.6
>>         git init
>>         git remote add linus git://git.kernel.org/pub/scm/linux/ 
>> kernel/git/
>> torvalds/linux-2.6.git
>>         git remote add origin ssh://jonsmirl1@git.digispeaker.com/~/
>> mpc5200b.git
>>         git fetch linus
>>         git fetch origin
>>         git checkout -b master origin/master
>>
>> The general idea should be correct. You have a non-standard
>> setup, so avoid git-clone.
>
> What should I do to standardize the setup so that 'clone/pull' will
> work on it?

Pull should work after you checked out origin/master. Pull should
fetch from origin and merge to local master.

But I don't see a way how you could use clone for your setup.


> I created a master branch. I gave up on fighting with
> gitweb and no branch named master.

I don't understand your comment about gitweb.


> I'd like to do this, but I can't figure out how.
>
> git clone linus
> move origin to digispeaker
> git pull
>
> There doesn't seem to be a simple way to redirect the origin.

I don't know a simple way.

	Steffen

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

* Re: Local branch to remote branch translation
  2007-11-12  6:25               ` Steffen Prohaska
@ 2007-11-12 13:53                 ` Jon Smirl
  0 siblings, 0 replies; 10+ messages in thread
From: Jon Smirl @ 2007-11-12 13:53 UTC (permalink / raw)
  To: Steffen Prohaska; +Cc: Git Mailing List

On 11/12/07, Steffen Prohaska <prohaska@zib.de> wrote:
>
> On Nov 11, 2007, at 11:46 PM, Jon Smirl wrote:
>
> > On 11/11/07, Steffen Prohaska <prohaska@zib.de> wrote:
> >>
> >> On Nov 11, 2007, at 10:20 PM, Jon Smirl wrote:
> >>
> >>> On 11/11/07, Steffen Prohaska <prohaska@zib.de> wrote:
> >>>>> jonsmirl@terra:~/mpc5200b$ git remote show linus
> >>>>> * remote linus
> >>>>>   URL: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/
> >>>>> linux-2.6.git
> >>>>>
> >>>>> How do I push the definition of the linus remote repo?
> >>>>
> >>>> You can't. Remotes are local to a repository. They cannot be
> >>>> "pushed" nor will they be "cloned" or "fetched".
> >>>
> >>> Dreamhost is way slow compared to kernel.org, so it is better to
> >>> clone
> >>> from kernel.org first and then pull from dreamhost. What is the
> >>> right
> >>> sequence of commands so that a new user will end up with a kernel
> >>> they
> >>> can use 'git pull' on to get updates from dreamhost? I'll add
> >>> these to
> >>> the repo description page.
> >>>
> >>> I'm trying this locally and I can't figure out the right sequence of
> >>> git command to redirect origin from kernel.org to dreamhost.
> >>
> >> How about the following (untested sequence)
> >>
> >>         mkdir linux-2.6
> >>         cd linux-2.6
> >>         git init
> >>         git remote add linus git://git.kernel.org/pub/scm/linux/
> >> kernel/git/
> >> torvalds/linux-2.6.git
> >>         git remote add origin ssh://jonsmirl1@git.digispeaker.com/~/
> >> mpc5200b.git
> >>         git fetch linus
> >>         git fetch origin
> >>         git checkout -b master origin/master
> >>
> >> The general idea should be correct. You have a non-standard
> >> setup, so avoid git-clone.
> >
> > What should I do to standardize the setup so that 'clone/pull' will
> > work on it?
>
> Pull should work after you checked out origin/master. Pull should
> fetch from origin and merge to local master.
>
> But I don't see a way how you could use clone for your setup.
>
>
> > I created a master branch. I gave up on fighting with
> > gitweb and no branch named master.
>
> I don't understand your comment about gitweb.

At http://git.digispeaker.com/
The short log, log, tree links won't work unless master exists.
Once master is there, everything works.


>
>
> > I'd like to do this, but I can't figure out how.
> >
> > git clone linus
> > move origin to digispeaker
> > git pull
> >
> > There doesn't seem to be a simple way to redirect the origin.
>
> I don't know a simple way.
>
>         Steffen
>
>
>


-- 
Jon Smirl
jonsmirl@gmail.com

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

end of thread, other threads:[~2007-11-12 13:53 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-11 17:54 Local branch to remote branch translation Jon Smirl
2007-11-11 18:02 ` Jon Smirl
2007-11-11 18:19   ` Steffen Prohaska
2007-11-11 19:36     ` Jon Smirl
2007-11-11 20:59       ` Steffen Prohaska
2007-11-11 21:20         ` Jon Smirl
2007-11-11 22:01           ` Steffen Prohaska
2007-11-11 22:46             ` Jon Smirl
2007-11-12  6:25               ` Steffen Prohaska
2007-11-12 13:53                 ` Jon Smirl

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).