Search code examples
gitgithubcommit

GitHub private repository default main branch


I'm tying to figure out, why Private repository on GitHub does not shows "Contribution activity" with Commits from same Primary Email, checked with adding of .patch at the end of the commit URL

Seems like, because Private repository is on the "master" branch, instead "main" (default), when Public repositories are also on "master" which in this case is (default), and "Contribution activity" shows progress.

I can change Default branch from repository settings "main" to "master" with unwanted consequences, but I'm not sure, why Private repository branch is "main" and (default) by default, and how to avoid this from beginning


Solution

  • I suspect it's simply a matter of time between the creation of both repos and the change of the default from Master to main.

    The term 'master' is a loaded term to many. Master can imply slave, master can also imply people who can and people who cannot. There is no need for git to call its default branch master, so this year a change was made to make 'main' the new default in Git as well as in Github. Github admins can set the default branch name for new repositories.

    But this won't affect existing repositories, unless the repository owner checks out master, creates a main branch from it and pushes that to GitHub. After that the repo owner can change the current default branch for the existing repository and delete the old master branch. No data is lost in this operation, but CI triggers, service hooks and badges may need to be updated.

    So what I suspect happened: the private repo was made before the new default was set.

    BTW there is a setting to show or hide private contributions