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

Re: Renaming the "master" branch without breaking existing clones

From
Matt McCutchen <matt@mattmccutchen.net>
Date
Aug 4, 2020, 00:37 UTC
Message-ID
<baea11c61973ff4be5ad33499d80f8629e2e1261.camel@mattmccutchen.net>
In-Reply-To
<20200803194006.GA2715275@coredump.intra.peff.net>
On Mon, 2020-08-03 at 15:40 -0400, Jeff King wrote:
Show 5 quoted lines
> The real trick is that you can't create or update symbolic refs on the
> server side using a client. So this would have to be something that
> hosting providers allow (and there might be some security implications;
> I'm not sure what happens if you create a loop in the symref
> resolution).

Right, repository administrators need some kind of support for the hosting provider (whether symrefs or something custom), otherwise the best they can do is develop their own process to mirror the new branch to the old branch.

GitHub mentions a plan to support a branch rename that would redirect at least fetches of the old name, though it is short on details:

https://github.com/github/renaming#later-this-year-seamless-move-for-existing-repositories-
I've just filed feature requests for BitBucket and GitLab:

https://jira.atlassian.com/browse/BCLOUD-20349 https://gitlab.com/gitlab-org/gitlab/-/issues/233427#related-issues

Anyone want to check on other major providers?
Matt
Previous: Junio C HamanoNext: Matt McCutchen
Message 11 of 17 in “Renaming the "master" branch without breaking existing clones”
  1. Matt McCutchenAug 3, 2020
  2. Taylor BlauAug 3, 2020
  3. Junio C HamanoAug 3, 2020
  4. Taylor BlauAug 3, 2020
  5. Jeff KingAug 3, 2020
  6. Junio C HamanoAug 3, 2020
  7. Jeff KingAug 3, 2020
  8. Junio C HamanoAug 3, 2020
  9. Jeff KingAug 3, 2020
  10. Junio C HamanoAug 3, 2020
  11. Matt McCutchenAug 4, 2020
  12. Matt McCutchenAug 4, 2020
  13. Junio C HamanoAug 3, 2020
  14. Matt McCutchenAug 3, 2020
  15. Kaartic SivaraamAug 3, 2020
  16. Junio C HamanoAug 3, 2020
  17. Kaartic SivaraamAug 4, 2020

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.