This question is somewhat related to this question: Is it possible to have a git repo inside another git repo
Here is the summary:
I had a git repo, which I pushed to my web host. I seperated a subdirectory of that repo, and added that subdirectory back as submodule. Now I am going to remove that subdirectory from my web host, create an empty git repository there, and push my submodule there. So, I was wondering what does –bare switch do, and do I need it.
As a side note, I am git beginner.
The
--bareswitch makes it so that the repository has no working directory; you will be unable to check out any branches or manipulate files directly.Without
--barethe repository data will be created in$REPO_ROOT/.git. With--barethe repository data will be created in$REPO_ROOT.You’d typically use this option when the purpose of the repository is to serve as a clone/push/pull point for other repositories.