Skip to content

Instantly share code, notes, and snippets.

View internalsystemerror's full-sized avatar

Gary Lockett internalsystemerror

View GitHub Profile
@internalsystemerror
internalsystemerror / git-checkout-default
Last active September 19, 2022 13:57
Switch to the default branch of a specified remote git repository
#!/usr/bin/env bash
set -e
USAGE="Usage:
git-checkout-default <remote>"
# show help if requested
if [ "x$1" == "x-h" ] || [ "x$1" == "x-?" ] || [ "x$1" == "x--help" ]; then
echo "Switch to the default branch of a specified remote git repository."
@internalsystemerror
internalsystemerror / fesd
Last active September 19, 2022 16:52 — forked from legeyda/foreach
Bash script to execute a given command in all subdirectories of the current directory
#!/usr/bin/env bash
set -e
trap "exit" INT
USAGE="Usage:
fesd <command>"
# show help if requested
if [ "x$1" == "x-h" ] || [ "x$1" == "x-?" ] || [ "x$1" == "x--help" ]; then