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

Re: git rebase: yet another newbie quest.

From
John Keeping <john@keeping.me.uk>
Date
Sep 5, 2014, 22:13 UTC
Message-ID
<20140905221336.GB701@serenity.lan>
In-Reply-To
<87a96ecqe9.fsf@osv.gnss.ru>

On Fri, Sep 05, 2014 at 02:28:46PM +0400, Sergey Organov wrote: ...

Show 7 quoted lines
> # Then I realize I need more changes and it gets complex enough to
> # warrant a topic branch. I create the 'topic' branch that will track
> # 'master' branch and reset 'master' back to its origin (remote
> # origin/master in original scenario).
> 
> git checkout -b topic
> git branch --force master origin_master

This line is the problem, because the purpose of the `--fork-point` argument to `git rebase` is designed to help people recover from upstream rebases, which is essentially what you create here. So when rebase calculates the local changes it realises (from the reflog) that the state of master before this command was before you created the branch, so only commits after it should be picked.

For the case when the upstream of a branch is remote, this is normally what you want.

Previous: Sergey OrganovNext: Sergey Organov
Message 8 of 9 in “git rebase: yet another newbie quest.”
  1. Sergey OrganovSep 5, 2014
  2. Theodore Ts'oSep 5, 2014
  3. Sergey OrganovSep 8, 2014
  4. Theodore Ts'oSep 8, 2014
  5. Sergey OrganovSep 8, 2014
  6. Theodore Ts'oSep 8, 2014
  7. Sergey OrganovSep 8, 2014
  8. John KeepingSep 5, 2014
  9. Sergey OrganovSep 8, 2014

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.