3 ms·
A StackOverflow thread describes some ways to do this when creating a new git repo. Here's an alias that seems to work: # https://stackoverflow.com/q/42871
by chmaynard 6y ago
A StackOverflow thread describes some ways to do this when creating a new git repo. Here's an alias that seems to work:
# https://stackoverflow.com/q/42871542/2040410
new = !git init && git checkout -b main && git commit --allow-empty -m \"new\"
It's possible this alias will leave "master" defined but in a detached state (not pointing to a commit). I haven't checked this.