Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save imZack/a7fd51b592e8fc85360112e932b4e02d to your computer and use it in GitHub Desktop.
Save imZack/a7fd51b592e8fc85360112e932b4e02d 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