Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is 'git --bare init' wrong?

Tags:

git

Is git --bare init wrong?

Should it be:

git init --bare
like image 434
Blankman Avatar asked Nov 27 '10 18:11

Blankman


1 Answers

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.

like image 172
earl Avatar answered Sep 20 '22 01:09

earl