myhome/.local/bin/gswitch

10 lines
208 B
Plaintext
Raw Normal View History

2023-03-02 11:03:59 +01:00
#!/bin/bash
BRANCH=$1
2023-10-04 23:21:30 +02:00
git checkout main
git checkout master
2023-03-02 11:03:59 +01:00
git checkout -b "$BRANCH"
git checkout "$BRANCH"
git branch --set-upstream-to=origin/"$BRANCH" "$BRANCH"
git pull
git reset --hard origin/"$BRANCH"