Q:

How do you create the 'master' branch on git if you forgot to create it before branching?

Someone recently created a repo locally, branched off, and only pushed the branch to remote. Is it possible for another person to create the 'master' branch without any commits, and push it to the remote?

A:

No. You cannot have a branch with no commits, and no master branch ever has no commits. master does not exist in a Git repository until your first commit.
When you make a new Git repository, .git/refs/HEAD will contain the following:
ref: refs/heads/master

However, refs/heads/master does not yet exist, and won't until you commit. There is no master branch until your first commit, and there is nothing to push.
You can use git log to find your earliest commit, and create master pointing to that commit, which is exactly what would happen with a new repository.
For more information: fatal: Not a valid object name: 'master'

