Skip to content

Instantly share code, notes, and snippets.

@chiastolite
Last active September 20, 2018 15:08
Show Gist options
  • Save chiastolite/97eef9bd5cc9f1e0502fe7095d9d3007 to your computer and use it in GitHub Desktop.
Save chiastolite/97eef9bd5cc9f1e0502fe7095d9d3007 to your computer and use it in GitHub Desktop.
#!/bin/bash
if [ $# -ne 1 ]; then
echo 'Usage: git new repository_name'
exit 1
fi
REPO_NAME=$1
REPO_DIR=$(ghq root)/github.com/$(whoami)/$REPO_NAME
if [ -e $REPO_DIR ]; then
echo "Already exist: $REPO_NAME"
exit 1
fi
mkdir -p $REPO_DIR
cd $REPO_DIR
git init
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment