4 ms·
So if i create a repo locally, where the default branch name is still master, commit some work to it, then create a repo on GitHub, where the default name is no
by twic 6y ago
So if i create a repo locally, where the default branch name is still master, commit some work to it, then create a repo on GitHub, where the default name is now main, then push my local repo to GitHub, will my commits appear on the repo page? Or will it present an empty main branch?
I always create repos this way - i never create on GitHub then clone the empty repo. It would be annoying if this stopped working smoothly.
- ndepoel 6y agoThe repo is always going to be leading. If you create a repo locally with a master branch and push it to Github, it will still have a master branch on Github and all the commits will be visible normally. Github is not going to automatically add an empty main branch without your permission. The only difference is that Github might not assume the name 'master' for the default branch anymore, so you may have to change the default branch in the project's settings on Github. Possibly Github will detect that there's only one branch and set it as the default, or recognize 'master' as the initial default branch. We'll have to wait and see what the exact behavior will be. Either way it won't stop you from using a Git repo with traditional naming conventions on Github in any shape or form.