Skip to content

How to preserve refspec to patches and branches after the repo renamed 'master' to 'main' #49017

Closed

Description

@Nirmal4G

For all those who can't pull master, it has renamed to main.

To preserve refspec to patches and branches, just changing the heads/master to heads/main should work.

[remote "origin"]
	url = https://github.com/dotnet/runtime
-	fetch = +refs/heads/master:refs/remotes/origin/master
+	fetch = +refs/heads/main:refs/remotes/origin/master
	tagopt = --no-tags
[branch "master"]
	remote = origin
-	merge = refs/heads/master
+	merge = refs/heads/main

Putting this out there, if anyone else facing similar issue with git.

Activity

  1. ghost added
    untriaged
    on Mar 2, 2021
  2. Nirmal4G commented on Mar 2, 2021

    @Nirmal4G
    Author

    Alternative to #48357. For those who cannot change the default branch for obvious 😉 reasons.

  3. ViktorHofer commented on Mar 2, 2021

    @ViktorHofer
    Member

    Closing in favor of #48357

  4. added
    question
    and removed on Mar 2, 2021
  5. removed
    untriaged
    on Mar 3, 2021
  6. ghost locked as resolved and limited conversation to collaborators on Apr 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-Infrastructurequestion

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions