Created
August 7, 2025 10:54
-
-
Save ScottJWalter/4d62880ee03ce36d322eb173ed7f0eca to your computer and use it in GitHub Desktop.
create upstream repo from current folder
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
# create upstream repo from current folder | |
# optional params allow for alternate repo name, private repo, and auto-push (in order) | |
export GITHUB_AUTO_PUSH="--push" | |
gh repo create [alternate-upstream-name] [--private] --source=. --remote=${GITHUB_DEFAULT_REMOTE:-origin} ${GITHUB_AUTO_PUSH:-[--push] | |
git config --global alias.ghcreate '!f() { | |
REPO_NAME=${1:-$(basename $(pwd))} | |
REMOTE_NAME=${2:-origin} | |
VISIBILITY=${3:-private} | |
if [ "$VISIBILITY" = "public" ]; then | |
gh repo create "$REPO_NAME" --public --source=. --remote="$REMOTE_NAME" --push | |
else | |
gh repo create "$REPO_NAME" --private --source=. --remote="$REMOTE_NAME" --push | |
fi | |
}; f' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment