Last active
March 29, 2021 09:07
-
-
Save Pelt10/289d3134136deafeae99b68f33910337 to your computer and use it in GitHub Desktop.
Convert directory with git bare repo (Gitlab repo) to normal repo
This file contains 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
echo "****************************************************" | |
echo "* *" | |
echo "* CONVERT BARE REPO TO NORMAL REPO *" | |
echo "* *" | |
echo "****************************************************" | |
echo " -> untar repo.tar.gz" | |
tar -zxf repo.tar.gz | |
for user in $(ls repositories/); do | |
for repo in $(ls repositories/$user/); do | |
pathRepo="repositories/$user/$repo/"; | |
if [ -d $pathRepo ]; then | |
echo " -> Conversion of $user/$repo"; | |
mkdir $(echo "$pathRepo.git"); | |
mv $(echo "$pathRepo* $pathRepo.git"); | |
cd $(echo "$pathRepo"); | |
git config --local --bool core.bare false; | |
git reset --hard; | |
cd ../../.. | |
fi | |
done | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment