Test
This commit is contained in:
Executable
+22
@@ -0,0 +1,22 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# Skript: Dev in Master mergen
|
||||||
|
|
||||||
|
DEV_BRANCH="dev"
|
||||||
|
MASTER_BRANCH="master"
|
||||||
|
|
||||||
|
# Auf master wechseln und aktuell holen
|
||||||
|
git checkout $MASTER_BRANCH
|
||||||
|
git pull origin $MASTER_BRANCH
|
||||||
|
|
||||||
|
# Dev aktuell holen
|
||||||
|
git checkout $DEV_BRANCH
|
||||||
|
git pull origin $DEV_BRANCH
|
||||||
|
|
||||||
|
# Merge Dev in Master
|
||||||
|
git checkout $MASTER_BRANCH
|
||||||
|
git merge --no-ff $DEV_BRANCH -m "Merge $DEV_BRANCH into $MASTER_BRANCH"
|
||||||
|
|
||||||
|
# Push Master auf Remote
|
||||||
|
git push origin $MASTER_BRANCH
|
||||||
|
|
||||||
|
echo "Branch $DEV_BRANCH wurde in $MASTER_BRANCH gemerged."
|
||||||
Executable
+41
@@ -0,0 +1,41 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# Skript: Feature in Dev mergen mit Auswahl der Feature-Branches
|
||||||
|
|
||||||
|
DEV_BRANCH="dev"
|
||||||
|
|
||||||
|
# Auflisten aller Feature-Branches (lokal und remote)
|
||||||
|
echo "Verfügbare Feature-Branches:"
|
||||||
|
FEATURE_BRANCHES=$(git branch -r | grep 'origin/feature/' | sed 's|origin/||')
|
||||||
|
PS3="Bitte wähle einen Feature-Branch zum Mergen: "
|
||||||
|
|
||||||
|
# in ein Array konvertieren
|
||||||
|
BRANCH_ARRAY=($FEATURE_BRANCHES)
|
||||||
|
|
||||||
|
# Auswahlmenü anzeigen
|
||||||
|
select CHOSEN_BRANCH in "${BRANCH_ARRAY[@]}"; do
|
||||||
|
if [[ -n "$CHOSEN_BRANCH" ]]; then
|
||||||
|
FEATURE_BRANCH=$CHOSEN_BRANCH
|
||||||
|
break
|
||||||
|
else
|
||||||
|
echo "Ungültige Auswahl. Bitte erneut versuchen."
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
echo "Ausgewählter Feature-Branch: $FEATURE_BRANCH"
|
||||||
|
|
||||||
|
# Dev aktuell holen
|
||||||
|
git checkout $DEV_BRANCH
|
||||||
|
git pull origin $DEV_BRANCH
|
||||||
|
|
||||||
|
# Feature-Branch aktuell holen
|
||||||
|
git checkout $FEATURE_BRANCH
|
||||||
|
git pull origin $FEATURE_BRANCH
|
||||||
|
|
||||||
|
# Merge Feature in Dev
|
||||||
|
git checkout $DEV_BRANCH
|
||||||
|
git merge --no-ff $FEATURE_BRANCH -m "Merge $FEATURE_BRANCH into $DEV_BRANCH"
|
||||||
|
|
||||||
|
# Push Dev auf Remote
|
||||||
|
git push origin $DEV_BRANCH
|
||||||
|
|
||||||
|
echo "Feature $FEATURE_BRANCH wurde erfolgreich in $DEV_BRANCH gemerged."
|
||||||
Executable
+36
@@ -0,0 +1,36 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# Skript: Branch auswählen und wechseln
|
||||||
|
|
||||||
|
# Alle Branches abrufen (lokal + remote)
|
||||||
|
git fetch --all --prune
|
||||||
|
|
||||||
|
# Lokale Branches
|
||||||
|
LOCAL_BRANCHES=$(git branch | sed 's/* //')
|
||||||
|
# Remote Branches (ohne origin/HEAD)
|
||||||
|
REMOTE_BRANCHES=$(git branch -r | grep -v 'HEAD' | sed 's|origin/||')
|
||||||
|
|
||||||
|
# Alle Branches zusammenführen und Duplikate entfernen
|
||||||
|
ALL_BRANCHES=$(echo -e "$LOCAL_BRANCHES\n$REMOTE_BRANCHES" | sort -u)
|
||||||
|
|
||||||
|
# Array erstellen
|
||||||
|
BRANCH_ARRAY=($ALL_BRANCHES)
|
||||||
|
|
||||||
|
echo "Verfügbare Branches:"
|
||||||
|
PS3="Bitte wähle einen Branch zum Wechseln: "
|
||||||
|
|
||||||
|
# Auswahlmenü
|
||||||
|
select CHOSEN_BRANCH in "${BRANCH_ARRAY[@]}"; do
|
||||||
|
if [[ -n "$CHOSEN_BRANCH" ]]; then
|
||||||
|
echo "Wechsle zu Branch: $CHOSEN_BRANCH"
|
||||||
|
# Prüfen, ob lokaler Branch existiert
|
||||||
|
if git show-ref --verify --quiet refs/heads/$CHOSEN_BRANCH; then
|
||||||
|
git checkout $CHOSEN_BRANCH
|
||||||
|
else
|
||||||
|
# Remote-Branch auschecken
|
||||||
|
git checkout -b $CHOSEN_BRANCH origin/$CHOSEN_BRANCH
|
||||||
|
fi
|
||||||
|
break
|
||||||
|
else
|
||||||
|
echo "Ungültige Auswahl. Bitte erneut versuchen."
|
||||||
|
fi
|
||||||
|
done
|
||||||
Reference in New Issue
Block a user