Last active
June 19, 2020 00:22
Create GitHub Repo with only a main branch
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 bash | |
mkdir -p $HOME/tmp/$1 && cd $HOME/tmp/$1 | |
git init | |
gh repo create -d "$2" --public | |
git remote set-url origin [email protected]:bashfulrobot/$1.git | |
git checkout -b main | |
echo "$2" >> README | |
git add README | |
git commit -a -m "🎉 Initial Commit" | |
git push --set-upstream origin main | |
git branch -D master | |
git fetch --prune |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment