Skip to content

Instantly share code, notes, and snippets.

@x0000ff
Last active June 1, 2023 15:54
Show Gist options
  • Save x0000ff/df054cc138fa22ed91915c0184b56f74 to your computer and use it in GitHub Desktop.
Save x0000ff/df054cc138fa22ed91915c0184b56f74 to your computer and use it in GitHub Desktop.
clear-branches

Run shell script on gist

Shells that support process substitution such as bash and zsh allow to run shell script on gist as follows.

# With curl:
bash <(curl -sL ${GIST_URL}) args...

# With wget:
bash <(wget -nv -O - ${GIST_URL}) args...

# If wget-log is generated:
# https://bugs.launchpad.net/ubuntu/+source/wget/+bug/1765690
bash <(wget -o /dev/null -nv -O - ${GIST_URL}) args...

For example:

bash <(curl -sL https://gist.githubusercontent.com/x0000ff/df054cc138fa22ed91915c0184b56f74/raw/d615e0df62c5e5be5d7557b47da6f42e50a49555/clear-branches.sh)
#!/usr/bin/env bash
git tag -l | xargs git tag -d
git push --delete origin MultipartRemoved
git push --delete origin Needs-QA
git push --delete origin QA-Needed
git push --delete origin QA_Needed
git push --delete origin before-kot
git push --delete origin before-merge
git push --delete origin before-rebase-5691
git push --delete origin before-starsview
git push --delete origin beforeßkot
git push --delete origin doNotDeletePlease
git push --delete origin feature/PQP-2120_no_payment_methods_popup
git push --delete origin kote-before
git push --delete origin old_version
git push --delete origin proposal/Danger
git push --delete origin 15113
git push --delete origin 22.04.2022
git push --delete origin before-kot-2
git push --delete origin before-merge-13023
git push --delete origin before-rebase-kot
git push --delete origin kot-fix
git push --delete origin old-remote
git push --delete origin xxx
git fetch --tags
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment