Skip to content

Instantly share code, notes, and snippets.

@spuder
Last active Mar 28, 2022
Embed
What would you like to do?
Bash create git repo for CAd files
# A bash function that will create a new git repo and configure the user.email
# Usage: Add this to your ~/.bashrc or ~/.bash_profile or ~/.zshrc files
function f360 {
_basepath="${HOME}/Code/github/spuder"
if [[ -z "$1" ]]; then echo "Usage: f360 foobar"; return 1; fi
if [[ ! -d "${_basepath}" ]]; then echo "${_basepath} doesn't exist"; return 1; fi
if [[ -d "${_basepath}/$1" ]]; then echo "Directory ${_basepath}/${1} already exists"; return 1; fi
echo "Creating ${_basepath}/${1}"
mkdir $_basepath/$1
cd $_basepath/$1
echo "running git init"
git init
echo "running git config"
git config user.email <redacted>@gmail.com
git config user.name "Spencer Owen"
#TODO: Create github repo
# git clone
#git submodule update --init
# rm CAD/*
# rm photos/*
# make clean
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment