dotfiles/.local/bin/push_custom.sh

22 lines
534 B
Bash
Raw Normal View History

#!/bin/bash
# For all repos with custom branch below, add a git remote and push to said remote
# @xstefen
BRANCH=lineage-20.0-x
LIST=$(repo status | grep "$BRANCH" | awk '{print $2}' | sed 's/.$//')
TOP=$(pwd)
for REPO in $LIST
do
DEST=android_"$(echo "$REPO" | sed 's/\//_/g')".git
cd "$REPO" || exit
git remote remove xstefen
git remote add xstefen git@git.xstefen.dev:xstefen/"$DEST"
echo
echo pushing "$BRANCH" to "$DEST"
echo
git push -u xstefen "$BRANCH"
sleep 2
cd "$TOP" || exit
done