innital commit

This commit is contained in:
thomas 2025-07-01 17:03:31 +02:00
parent c3e800d2da
commit ce3ffa2728
1 changed files with 27 additions and 0 deletions

View File

@ -56,6 +56,33 @@ git branch -M main 2>/dev/null
git push -u origin main
# Setze Standard-Branch auf main per Gitea-API (nur bei Neuanlage)
if [ "$NEWREPO" = "1" ]; then
curl -s -X PATCH -H "Content-Type: application/json" -H "Authorization: token $GITEA_TOKEN" \
-d '{"default_branch":"main"}' "$GITEA_URL/api/v1/repos/$GITEA_USER/$REPO_VALID" > /dev/null
echo "Upload abgeschlossen. Repo: $GITURL (neu angelegt, Standard-Branch: main)"
else
echo "Upload abgeschlossen. Repo: $GITURL (bestehendes Repo aktualisiert)"
fi
# Prüfe, ob der Branch 'main' auf Gitea existiert
BRANCHES=$(curl -s -H "Authorization: token $GITEA_TOKEN" "$GITEA_URL/api/v1/repos/$GITEA_USER/$REPO_VALID/branches" | grep '"name":"main"')
if [ -z "$BRANCHES" ]; then
echo "Warnung: Der Branch 'main' existiert auf Gitea nicht! Prüfe, ob du auf den richtigen Branch gepusht hast."
echo "Evtl. ist der Standard-Branch noch 'master'."
fi
# Anleitung für das manuelle Umstellen des Standard-Branches in Gitea:
: <<'GITEA_BRANCH_HELP'
So stellst du den Standard-Branch in Gitea auf 'main' um:
1. Öffne das Repository im Gitea-Webinterface.
2. Klicke oben rechts auf 'Settings'.
3. Wähle im Menü links 'Branches'.
4. Wähle im Dropdown 'Default Branch' den Branch 'main' aus.
5. Klicke auf 'Save' oder 'Speichern'.
Jetzt ist 'main' der Standard-Branch und wird beim Öffnen des Repos angezeigt.
GITEA_BRANCH_HELP
# Setze Standard-Branch auf main per Gitea-API (nur bei Neuanlage)
if [ "$NEWREPO" = "1" ]; then
curl -s -X PATCH -H "Content-Type: application/json" -H "Authorization: token $GITEA_TOKEN" \