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

Re: How do I copy a branch & its config to a new name?

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Mar 22, 2017, 23:54 UTC
Message-ID
<CACBZZX47euh-K8-DUjDKr6i=g8MzmivOzA5fFTyPQjZhkzM2uA@mail.gmail.com>
In-Reply-To
<20170322225800.3h2mnnmmj2hbo36c@sigill.intra.peff.net>
On Wed, Mar 22, 2017 at 11:58 PM, Jeff King <peff@peff.net> wrote:
Show 13 quoted lines
> On Wed, Mar 22, 2017 at 11:46:14PM +0100, Ævar Arnfjörð Bjarmason wrote:
>
>> But both of these are really just a limited special case for what I'd
>> really like, which is given branch "foo", copy it and all its
>> configuration to a new name "bar". I.e. both of the hacks above only
>> set up the correct tracking info, but none of the other branch.*
>> variables I may have set.
>
> I thought that's what "git branch -m" was for, though I don't know how
> thorough it is about finding config that refers _to_ your branch (I know
> it handles config _for_ your branch).
>
> There might be room for improvement there.

-m can only rename "foo" -> "bar", but I'd like to end up with a new "bar" with the same config as "foo"

Previous: Jeff KingNext: Jeff King
Message 3 of 7 in “How do I copy a branch & its config to a new name?”
  1. Ævar Arnfjörð BjarmasonMar 22, 2017
  2. Jeff KingMar 22, 2017
  3. Ævar Arnfjörð BjarmasonMar 22, 2017
  4. Jeff KingMar 22, 2017
  5. Jonathan NiederMar 24, 2017
  6. Ævar Arnfjörð BjarmasonMar 24, 2017
  7. Jeff KingMar 24, 2017

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.