How do you make an existing repository bare?

Technology CommunityCategory: GitHow do you make an existing repository bare?
VietMX Staff asked 3 years ago

Run the command below:

git clone --mirror <repo_source_path>

The --mirror flag maps all refs (including remote-tracking branches, notes etc.) and sets up a refspec configuration such that all these refs are overwritten by a git remote update in the target repository.