Skip to content

Instantly share code, notes, and snippets.

@Pelt10
Last active March 29, 2021 09:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save Pelt10/289d3134136deafeae99b68f33910337 to your computer and use it in GitHub Desktop.
Save Pelt10/289d3134136deafeae99b68f33910337 to your computer and use it in GitHub Desktop.
Convert directory with git bare repo (Gitlab repo) to normal repo
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