# Cherry-picking to remote branches

6 messages from 2007-07-06 to 2007-07-07. Participants: Sean Kelley, Johannes Schindelin, VMiklos.
Thread: https://gitlist.dev/t/8893

## Sean Kelley, 2007-07-06 14:09

Subject: Cherry-picking to remote branches
Message-ID: <a2e879e50707060709oc9fe8b3k8e594f1cb6e10437@mail.gmail.com>
URL: https://gitlist.dev/e/a2e879e50707060709oc9fe8b3k8e594f1cb6e10437%40mail.gmail.com

```
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, 2007-07-06 14:26

Subject: Re: Cherry-picking to remote branches
Message-ID: <Pine.LNX.4.64.0707061524180.4093@racer.site>
URL: https://gitlist.dev/e/Pine.LNX.4.64.0707061524180.4093%40racer.site
In-Reply-To: <a2e879e50707060709oc9fe8b3k8e594f1cb6e10437@mail.gmail.com>

```
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".

Hth,
Dscho

```

## Sean Kelley, 2007-07-06 14:39

Subject: Re: Cherry-picking to remote branches
Message-ID: <a2e879e50707060739s4c8e751dj494618d3d545277b@mail.gmail.com>
URL: https://gitlist.dev/e/a2e879e50707060739s4c8e751dj494618d3d545277b%40mail.gmail.com
In-Reply-To: <Pine.LNX.4.64.0707061524180.4093@racer.site>

```
Hi

On 7/6/07, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
> 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
>
> Hth,
> Dscho
>
>

```

## VMiklos, 2007-07-06 15:01

Subject: Re: Cherry-picking to remote branches
Message-ID: <20070706150155.GV32766@genesis.frugalware.org>
URL: https://gitlist.dev/e/20070706150155.GV32766%40genesis.frugalware.org
In-Reply-To: <a2e879e50707060739s4c8e751dj494618d3d545277b@mail.gmail.com>

```
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

VMiklos

-- 
developer of Frugalware Linux - http://frugalware.org

```

## Sean Kelley, 2007-07-06 15:10

Subject: Re: Cherry-picking to remote branches
Message-ID: <a2e879e50707060810v6b3f0a9ctda4f3fa12c284e0e@mail.gmail.com>
URL: https://gitlist.dev/e/a2e879e50707060810v6b3f0a9ctda4f3fa12c284e0e%40mail.gmail.com
In-Reply-To: <20070706150155.GV32766@genesis.frugalware.org>

```
Hi,

On 7/6/07, VMiklos <vmiklos@frugalware.org> wrote:
> 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
>
> VMiklos
>
> --
> developer of Frugalware Linux - http://frugalware.org
>
>

```

## Sean Kelley, 2007-07-07 13:00

Subject: Re: Cherry-picking to remote branches
Message-ID: <a2e879e50707070600qc89b4dey4847d7bb6d01e1e5@mail.gmail.com>
URL: https://gitlist.dev/e/a2e879e50707070600qc89b4dey4847d7bb6d01e1e5%40mail.gmail.com
In-Reply-To: <a2e879e50707060709oc9fe8b3k8e594f1cb6e10437@mail.gmail.com>

```
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
>
> 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
>

```
