All of lore.kernel.org
 help / color / mirror / Atom feed
* branch rebase and push
@ 2006-12-19  3:39 SungHyun Nam
  2006-12-19  9:57 ` Jakub Narebski
  0 siblings, 1 reply; 4+ messages in thread
From: SungHyun Nam @ 2006-12-19  3:39 UTC (permalink / raw)
  To: git

Hello,

Can I push a branch after rebase?
I got a error message:
   error: remote 'refs/heads/br' is not a strict subset of local ref
   'refs/heads/br'. maybe you are not up-to-date and need to pull first?

It worked fine if I did:
  $ git checkout -b br
  $ git pull . master
  $ git checkout master
  $ git pull
  $ git push

But I got above error message if I did:
  $ git checkout br
  $ git rebase master
  $ git checkout master
  $ git pull
  $ git push

Thanks.
namsh




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

* Re: branch rebase and push
  2006-12-19  3:39 branch rebase and push SungHyun Nam
@ 2006-12-19  9:57 ` Jakub Narebski
       [not found]   ` <4587BD31.9030804@gmail.com>
  0 siblings, 1 reply; 4+ messages in thread
From: Jakub Narebski @ 2006-12-19  9:57 UTC (permalink / raw)
  To: git

SungHyun Nam wrote:

> Can I push a branch after rebase?
> I got a error message:
>    error: remote 'refs/heads/br' is not a strict subset of local ref
>    'refs/heads/br'. maybe you are not up-to-date and need to pull first?
> 
> It worked fine if I did:
>   $ git checkout -b br
>   $ git pull . master
>   $ git checkout master
>   $ git pull
>   $ git push
> 
> But I got above error message if I did:
>   $ git checkout br
>   $ git rebase master
>   $ git checkout master
>   $ git pull
>   $ git push

The problem you have is with _push_, not branch, I think.

Does repository you pull from has rebased branch 'br'? If yes, is it
pulled with + in pull/fetch line? Perhaps (but read documentation first,
please) "git push --force" is what you want, provided that other side
doesn't forbid non fast-forward pushes.

Bu you usually don't rebase published branch (don't change history
of published branch). Equivalently, you don't publish rebased branch
until it is ready (or merged in ;-).

-- 
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git


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

* Re: branch rebase and push
       [not found]   ` <4587BD31.9030804@gmail.com>
@ 2006-12-19 11:58     ` Jakub Narebski
  2006-12-19 12:13       ` Johannes Schindelin
  0 siblings, 1 reply; 4+ messages in thread
From: Jakub Narebski @ 2006-12-19 11:58 UTC (permalink / raw)
  To: SungHyun Nam; +Cc: git

SungHyun Nam wrote:

> I'm sorry... but could you teach me how I publish the rebased branch?
> I think Junio does it for 'pu' branch.
> Is there recommended workflow? I cannot find.

Either have "Push:+refs/heads/br:refs/heads/br" in your
.git/remotes/<name> file, or it's equivalent config file
version, with '+' denoting that this branch sometimes does
not fast-forward.

Or use git push with --force option when you had rebased.

And of course the server you push to has to not have config variable 
receive.denyNonFastForwards set to true.
-- 
Jakub Narebski

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

* Re: branch rebase and push
  2006-12-19 11:58     ` Jakub Narebski
@ 2006-12-19 12:13       ` Johannes Schindelin
  0 siblings, 0 replies; 4+ messages in thread
From: Johannes Schindelin @ 2006-12-19 12:13 UTC (permalink / raw)
  To: Jakub Narebski; +Cc: SungHyun Nam, git

Hi,

On Tue, 19 Dec 2006, Jakub Narebski wrote:

> SungHyun Nam wrote:
> 
> > I'm sorry... but could you teach me how I publish the rebased branch?
> > I think Junio does it for 'pu' branch.
> > Is there recommended workflow? I cannot find.
> 
> Either have "Push:+refs/heads/br:refs/heads/br" in your
> .git/remotes/<name> file, or it's equivalent config file
> version, with '+' denoting that this branch sometimes does
> not fast-forward.
> 
> Or use git push with --force option when you had rebased.
> 
> And of course the server you push to has to not have config variable 
> receive.denyNonFastForwards set to true.

If that is the case, there is a work-around, which happens to be also nice 
to tracking parties:

	$ git pull -s ours <remote> <branch>
	$ git push <remote> <branch>

The disadvantage (which I'd argue is actually an advantage) is that you do 
not lose history. After all: "those who do not learn from history are 
doomed to repeat it".

Ciao,
Dscho

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

end of thread, other threads:[~2006-12-19 12:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-12-19  3:39 branch rebase and push SungHyun Nam
2006-12-19  9:57 ` Jakub Narebski
     [not found]   ` <4587BD31.9030804@gmail.com>
2006-12-19 11:58     ` Jakub Narebski
2006-12-19 12:13       ` Johannes Schindelin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.