Created
September 10, 2023 21:14
-
-
Save Clumsy-Coder/a452638c16766d91fc66e6185bd2a19a to your computer and use it in GitHub Desktop.
Convert cloned repo to a bare repo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env zsh | |
# convert cloned repo into bare repo. | |
# this to allow the usage of git worktrees | |
# obtained from | |
# https://stackoverflow.com/a/2200662/3053548 | |
cd repo | |
mv .git ../repo.git # renaming just for clarity | |
cd .. | |
rm -fr repo | |
cd repo.git | |
git config --bool core.bare true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment