Files
Advanced-Git/contents/git-init-bare.md
2025-07-11 02:45:16 +00:00

823 B

⬅️ Back to Git Command Reference (Full List)

git init --bare

Category: Repository Management

Initialize a bare repository, typically used for remote repositories.

Command

git init --bare my-repo.git

Examples

  • Create a bare repository for collaboration.
git init --bare my-repo.git
  • Initialize a bare repo in a custom directory for server hosting.
git init --bare /srv/git/project.git

Steps

  1. Run git init --bare my-repo.git to create a bare repository.

➡️ See the Next Step: git clone --mirror


Author: mike-rambil • Updated: 2024-06-10 • Tags: init, bare, repository