threads / discuss / 8893

Cherry-picking to remote branches

Subject: Cherry-picking to remote branches

## tl;dr

6 messages between Jul 6, 2007 and Jul 7, 2007.

replies: 5people: 3as markdown or json

Sean Kelley· Jul 6, 2007, 14:09 UTC · lore

I have been having trouble with the following workflow. I am trying to push changes to a remote from a branch that is tracking it.

git clone git://mysite.com/data/git/linux-devel.git linux-devel
cd linux-devel

git remote add -m master -f linux-stable git://mysite.com/data/git/linux-stable.git

git branch -r
  linux-stable/HEAD
  linux-stable/master
  origin/HEAD
  origin/master
git checkout -b stable linux-stable/master
git cherry-pick  b3b1eea69a   (a commit from linux-devel)
git push linux-stable

error: remote 'refs/heads/master' is not a strict subset of local ref 'refs/heads/master'. maybe you are not up-to-date and need to pull first? error: failed to push to 'git://mysite.com/data/git/linux-stable.git'

Thanks for your help,
Sean
Johannes Schindelin· Jul 6, 2007, 14:26 UTC · re: Sean Kelley · lore

Re: Cherry-picking to remote branches

Hi,
On Fri, 6 Jul 2007, Sean Kelley wrote:
Show 12 quoted lines
> [...]
>
> git checkout -b stable linux-stable/master
> 
> git cherry-pick  b3b1eea69a   (a commit from linux-devel)
> 
> git push linux-stable
> 
> error: remote 'refs/heads/master' is not a strict subset of local ref
> 'refs/heads/master'. maybe you are not up-to-date and need to pull
> first?
> error: failed to push to 'git://mysite.com/data/git/linux-stable.git'

Since you are obviously only interested in pushing the stable branch, why don't you

	git push linux-stable stable
Hm?

If you do not specify which branches to push, "git push" will find all refnames which are present both locally and remotely, and push those. Evidently, however, your local "master" disagrees with the remote "master".

Hth, Dscho

Sean Kelley· Jul 6, 2007, 14:39 UTC · re: Johannes Schindelin · lore

Re: Cherry-picking to remote branches

Hi
On 7/6/07, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
Show 28 quoted lines
> Hi,
>
> On Fri, 6 Jul 2007, Sean Kelley wrote:
>
> > [...]
> >
> > git checkout -b stable linux-stable/master
> >
> > git cherry-pick  b3b1eea69a   (a commit from linux-devel)
> >
> > git push linux-stable
> >
> > error: remote 'refs/heads/master' is not a strict subset of local ref
> > 'refs/heads/master'. maybe you are not up-to-date and need to pull
> > first?
> > error: failed to push to 'git://mysite.com/data/git/linux-stable.git'
>
> Since you are obviously only interested in pushing the stable branch, why
> don't you
>
>         git push linux-stable stable
>
> Hm?
>
> If you do not specify which branches to push, "git push" will find all
> refnames which are present both locally and remotely, and push those.
> Evidently, however, your local "master" disagrees with the remote
> "master".

It is not entirely clear to me from the documentation. So I was trying to cobble together something that seemed to make sense. I want to work from the devel clone. On occasion I want to cherry-pick changesets and push those to the stable branch. I don't want everything that goes into devel to go into stable.

Sean
Show 5 quoted lines
>
> Hth,
> Dscho
>
>
VMiklos· Jul 6, 2007, 15:01 UTC · re: Sean Kelley · lore

Re: Cherry-picking to remote branches

Na Fri, Jul 06, 2007 at 09:39:47AM -0500, Sean Kelley <svk.sweng@gmail.com> pisal(a):
Show 28 quoted lines
>> > git checkout -b stable linux-stable/master
>> >
>> > git cherry-pick  b3b1eea69a   (a commit from linux-devel)
>> >
>> > git push linux-stable
>> >
>> > error: remote 'refs/heads/master' is not a strict subset of local ref
>> > 'refs/heads/master'. maybe you are not up-to-date and need to pull
>> > first?
>> > error: failed to push to 'git://mysite.com/data/git/linux-stable.git'
>>
>> Since you are obviously only interested in pushing the stable branch, why
>> don't you
>>
>>         git push linux-stable stable
>>
>> Hm?
>>
>> If you do not specify which branches to push, "git push" will find all
>> refnames which are present both locally and remotely, and push those.
>> Evidently, however, your local "master" disagrees with the remote
>> "master".
>
> It is not entirely clear to me from the documentation.  So I was
> trying to cobble together something that seemed to make sense.  I want
> to work from the devel clone.  On occasion I want to cherry-pick
> changesets and push those to the stable branch.  I don't want
> everything that goes into devel to go into stable.
what about this?
        git push linux-stable stable:master
VMiklos
-- 
developer of Frugalware Linux - http://frugalware.org
Sean Kelley· Jul 6, 2007, 15:10 UTC · re: VMiklos · lore

Re: Cherry-picking to remote branches

Hi,
On 7/6/07, VMiklos <vmiklos@frugalware.org> wrote:
Show 33 quoted lines
> Na Fri, Jul 06, 2007 at 09:39:47AM -0500, Sean Kelley <svk.sweng@gmail.com> pisal(a):
> >> > git checkout -b stable linux-stable/master
> >> >
> >> > git cherry-pick  b3b1eea69a   (a commit from linux-devel)
> >> >
> >> > git push linux-stable
> >> >
> >> > error: remote 'refs/heads/master' is not a strict subset of local ref
> >> > 'refs/heads/master'. maybe you are not up-to-date and need to pull
> >> > first?
> >> > error: failed to push to 'git://mysite.com/data/git/linux-stable.git'
> >>
> >> Since you are obviously only interested in pushing the stable branch, why
> >> don't you
> >>
> >>         git push linux-stable stable
> >>
> >> Hm?
> >>
> >> If you do not specify which branches to push, "git push" will find all
> >> refnames which are present both locally and remotely, and push those.
> >> Evidently, however, your local "master" disagrees with the remote
> >> "master".
> >
> > It is not entirely clear to me from the documentation.  So I was
> > trying to cobble together something that seemed to make sense.  I want
> > to work from the devel clone.  On occasion I want to cherry-pick
> > changesets and push those to the stable branch.  I don't want
> > everything that goes into devel to go into stable.
>
> what about this?
>
>         git push linux-stable stable:master

That creates a new head on my remote server. Where as I wanted to push to the remotes head.

Sean
Show 7 quoted lines
>
> VMiklos
>
> --
> developer of Frugalware Linux - http://frugalware.org
>
>
Sean Kelley· Jul 7, 2007, 13:00 UTC · re: Sean Kelley · lore

Re: Cherry-picking to remote branches

On 7/6/07, Sean Kelley <svk.sweng@gmail.com> wrote:
> I have been having trouble with the following workflow.  I am trying
> to push changes to a remote from a branch that is tracking it.

Is there a better way to do this? Basically I want to push from the branch to the remote. But it doesn't seem to work at least without pushing the branch itself as a new head to the remote. Perhaps the better way to do it is to have two different directories:

1) clone the linux-devel.git and have a read-only remote to
linux-stable to fetch changes and cherry-pick.
2) clone the linux-stable.git and have a read-only remote to
linux-devel to fetch changes and cherry-pick
So you would just cd to the specific one you want to work with.
Sean
Show 31 quoted lines
>
> git clone git://mysite.com/data/git/linux-devel.git linux-devel
>
> cd linux-devel
>
> git remote add -m master -f linux-stable
> git://mysite.com/data/git/linux-stable.git
>
> git branch -r
>
>   linux-stable/HEAD
>   linux-stable/master
>   origin/HEAD
>   origin/master
>
> git checkout -b stable linux-stable/master
>
> git cherry-pick  b3b1eea69a   (a commit from linux-devel)
>
> git push linux-stable
>
> error: remote 'refs/heads/master' is not a strict subset of local ref
> 'refs/heads/master'. maybe you are not up-to-date and need to pull
> first?
> error: failed to push to 'git://mysite.com/data/git/linux-stable.git'
>
> Thanks for your help,
>
>
> Sean
>

← back to recent threads