git --bare init
错了吗?
应该是:
git init --bare
最佳答案
git --bare init
并没有错,它只是表达相同(尽管有错误)操作的不同方式。
快速浏览一下顶层 git(1) manpage将确认,--bare
是所有 Git 命令的全局选项,它会影响存储库目录的发现方式:
--bare
Treat the repository as a bare repository. If GIT_DIR environment
is not set, it is set to the current working directory.
最初,这是让 git 命令在“裸模式”下运行的唯一方法,这就是为什么你会在很多旧文档/教程中找到 git --bare init
. --bare
作为单独的选项被添加到 1.5.6 系列中,以改进 CLI。
关于git - 'git --bare init' 错了吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4293217/