Utility functions for interacting with github repositories from the command line.
- Run the following:
wget https://raw.githubusercontent.com/mzrimsek/github-helpers/master/.github_helpers
mv .github_helpers ~/
- Configure the file by setting the following environment variables:
GITHUB_USER
with your github usernameGITHUB_TOKEN
with a Personal Access Token which you can generate here.- Permissions required are noted on each function
Add each of these to your .bashrc
file
export GITHUB_USER="<your username>"
export GITHUB_TOKEN="<your token>"
- Add the file to your
.bashrc
file
if [ -f ~/.github_helpers ]; then
. ~/.github_helpers
fi
- Source your
.bashrc
Create and push a new repository
github-create <repository_name>
If no repository name is provided, you will be prompted for one. If you still proceed without supplying and name, the current working directory will be used as the root of the repository.
If at any point a repository name is provided, whether when initially running the function or after being prompted, the repository will be created in the subdirectory of the name provided. If that directory does not exist it will be created.