Use `main` (not `master`) for default branch in student repos?

Next month, Github will switch the name of the default git branch from master to main in new repos. Organizations and individuals can flip the switch already. I’ve done this with my classroom’s associated organization, but new student repos still seem to use master. Does anyone know if it’s possible to have the student repos honor the organization preferences? Thanks!

The branches on the student repositories come from the branches on the repository used to create the assignment. Just change the branch on the template repository and the student ones created after that point will use the new branch. (If you want only main, then be sure to remove any other branches.)

Be sure to test this change thoroughly, however. I attempted to change from master to main as the default branch and ran into an issue with GitHub Classroom and its integration with repl.it, which has been reported. In addition, I ran into issues with BlueJ and their GitHub integration. If the branch wasn’t named master, commits were not possible.

To note - these are issues that need to be corrected by the third parties (repl.it, BlueJ, etc). Be sure to contact them if you hit such bugs.

1 Like

Great point. I’ll go back and verify that I reported the issue to BlueJ. The GitHub Classroom and repl.it integration issue is an issue with Classroom and not repl.it. Specifically, when accepting assignments, the README isn’t updated to include the graphic and link to launch repl.it. That has been reported and is on the Classroom team’s radar.

© 2017 GitHub, Inc.
with by
GitHub Education