nvie / git-toolbelt

A suite of useful Git commands that aid with scripting or every day command line usage
BSD 3-Clause "New" or "Revised" License
1.25k stars 111 forks source link

(initial-commit) Report "No commits yet" for an empty repo (#12) #46

Closed ernstki closed 4 years ago

ernstki commented 4 years ago

Honestly, #12 was resolved in 04124c0ea66d04d77f65fa33ba56134a8f4146fb, however unintentionally. I think it would be perfectly fine to close this PR (without merging) and close #12 manually. But for the sake of discussion…

As it stands, if you run git initial-commit in an empty repo, you'll simply get

No main branch found

with an exit code of 2.

This PR simply incorporates Shea690901/git-toolbelt@f689f80bb16eb9c814549bf96d6261e9e14dee6c and adds its own No commits yet message.

nvie commented 4 years ago

Thank you, I agree, this is a much nicer error message 👍