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

Re: [PATCH v2] branch/checkout --track: Ensure that upstream branch is indeed a branch

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 18, 2011, 04:32 UTC
Message-ID
<7vk4gy55er.fsf@alter.siamese.dyndns.org>
In-Reply-To
<alpine.DEB.2.00.1102171937460.14950@debian>
Martin von Zweigbergk <martin.von.zweigbergk@gmail.com> writes:
> In some workflows (e.g. Linux kernel, IIRC), it is recommended to base
> your work on a tag.

But the thing is, "base your work on some known point" is a rule invented exactly to discourage casual and frequent rebasing.

If you started your work on v2.6.36 and need to rebase to a more recent version, you won't be using "rebase @{upstream}" notation _anyway_, as the old base you forked your work from that you would refer to as @{upstream} will not be moving. You will instead rebasing on top of a _different_ commit, perhaps v2.6.38 or something.

So the workflow would look more like: 
	$ git checkout -b frotz-2.6.36 v2.6.36
        ... develop "frotz" feature on top of 2.6.36
        ... time passes ...
	$ git checkout -b frotz-2.6.38 frotz-2.6.36
        $ git rebase --onto v2.6.38 v2.6.36
	... inspect the result and it looks good.
        ... if  you don't want frotz in 2.6.36 then...
        $ git branch -D frotz-2.6.36

There is not much point in using @{upstream} when your branch management is as disciplined as that recommended practice you cited.

Previous: Martin von Zweigbergk
Message 7 of 7 in “checkout/branch needs some extra safety around the --track option”
  1. Johan HerlandFeb 15, 2011
  2. Junio C HamanoFeb 15, 2011
  3. branch/checkout --track: Ensure that upstream branch is indeed a branchJohan Herland, Feb 16, 2011
  4. Junio C HamanoFeb 16, 2011
  5. branch/checkout --track: Ensure that upstream branch is indeed a branchJohan Herland, Feb 16, 2011
  6. Martin von ZweigbergkFeb 18, 2011
  7. Junio C HamanoFeb 18, 2011

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.