git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: branch rebase and push

From
Jakub Narebski <jnareb@gmail.com>
Date
Dec 19, 2006, 09:57 UTC
Message-ID
<em8cti$nff$1@sea.gmane.org>
In-Reply-To
<45875EFC.5090408@gmail.com>
SungHyun Nam wrote:
Show 18 quoted lines
> 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
Previous: SungHyun NamNext: Jakub Narebski
Message 2 of 4 in “branch rebase and push”
  1. SungHyun NamDec 19, 2006
  2. Jakub NarebskiDec 19, 2006
  3. Jakub NarebskiDec 19, 2006
  4. Johannes SchindelinDec 19, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.