Created
September 14, 2024 21:22
-
-
Save ernesto-jimenez/e4fec041da72736f127b8511a467234e to your computer and use it in GitHub Desktop.
Push graphite stack to git directly
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env sh | |
set -e | |
current_branch=$(git rev-parse --abbrev-ref HEAD) | |
gt ls -s -r | rg '(?<branch>[^ ]+)$' -o | rg -v '^(main|master)$' | \ | |
while read -r branch; do | |
gt co "${branch}" | |
git push --force-with-lease | |
done | |
gt co "${current_branch}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment