Skip to content

Instantly share code, notes, and snippets.

@bashfulrobot
Last active June 19, 2020 00:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bashfulrobot/e6f6c63ba3340875cdaedab57fa46270 to your computer and use it in GitHub Desktop.
Save bashfulrobot/e6f6c63ba3340875cdaedab57fa46270 to your computer and use it in GitHub Desktop.
Create GitHub Repo with only a main branch
#!/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 git@github.com: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