Is git --bare init
wrong?
Should it be:
git init --bare
git --bare init
is not wrong, it is just a different way to express the same (bugs notwithstanding) operation.
As a quick look at the toplevel git(1) manpage will confirm, --bare
is a global option for all Git commands which affects how the repository directory is discovered:
--bare
Treat the repository as a bare repository. If GIT_DIR environment
is not set, it is set to the current working directory.
Originally, this was the only way to have git commands operate in "bare mode", which is why you'll find git --bare init
in quite a lot of the older documents/tutorials. --bare
as separate option was added in the 1.5.6 series, to improve the CLI.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With