From 622c12b7acfb5610245a7db061e41436abc83547 Mon Sep 17 00:00:00 2001 From: GutPuncher Date: Mon, 20 Nov 2023 02:32:18 -0500 Subject: [PATCH] Add helper script for testing remote forks/PRs --- build/git-pr-switch.sh | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100755 build/git-pr-switch.sh diff --git a/build/git-pr-switch.sh b/build/git-pr-switch.sh new file mode 100755 index 00000000..d5b3585b --- /dev/null +++ b/build/git-pr-switch.sh @@ -0,0 +1,22 @@ +#!/bin/sh +# +# Checkout a (PR) fork branch locally for testing. +# +# + +echo +echo "git-pr-switch.sh -- Checkout a (PR) fork branch locally for testing." +echo +echo "Clean up your working directory before running this script." +echo +read -p "Enter fork author username: " FORK_USERNAME +echo $FORK_USERNAME +read -p "Enter fork branch name: " FORK_BRANCH +echo $FORK_BRANCH +FORK_LOCAL=$FORK_BRANCH"-testing" +echo "Creating new local branch for testing: "$FORK_LOCAL" ..." +git checkout -b $FORK_LOCAL +echo "Pulling changes from user's branch into new local branch..." +git pull https://github.com/$FORK_USERNAME/ZealOS.git $FORK_BRANCH + +