28 lines
998 B
Bash
28 lines
998 B
Bash
#!/bin/bash
|
|
|
|
# *** manually CREATE EVERY empty repos in a new Git server before using this script to migrate
|
|
|
|
# Old and new Gitea URLs
|
|
OLD_GITEA_URL="http://192.168.1.100:3000"
|
|
NEW_GITEA_URL="https://git.yiem.cc"
|
|
USERNAME="ton"
|
|
|
|
# Manually list the repo names (no token, so we can't fetch them via API)
|
|
REPOS=("GeneralUtils" "YiemAgent" "SQLLLM" "tonBookmarks" "LLMMCTS" "ImageUtils" "FormatCorrector" "ChatAgent_v2" "ChatAgent" "GeneralUtilsGPU" "Mosquitto" "CommUtils" "IronpenGPU" "Ironpen" "SNNUtils" "ANNUtils") # Add your repo names here
|
|
|
|
mkdir -p gitea-migration && cd gitea-migration
|
|
|
|
for REPO in "${REPOS[@]}"; do
|
|
echo "🔗 Cloning $REPO from old Gitea..."
|
|
git clone --mirror "$OLD_GITEA_URL/$USERNAME/$REPO.git"
|
|
|
|
cd "$REPO.git" || { echo "❌ Failed to enter $REPO.git"; exit 1; }
|
|
|
|
echo "📦 Pushing $REPO to new Gitea (will prompt for password)..."
|
|
git remote set-url origin "$NEW_GITEA_URL/$USERNAME/$REPO.git"
|
|
git push --mirror
|
|
|
|
cd ..
|
|
echo "✅ $REPO migrated!"
|
|
done
|