Last active
September 20, 2018 15:08
-
-
Save chiastolite/97eef9bd5cc9f1e0502fe7095d9d3007 to your computer and use it in GitHub Desktop.
This file contains 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
#!/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