Skip to content

Instantly share code, notes, and snippets.

@spuder
Last active March 28, 2022 18:50
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 spuder/1d5c8aee03db4ab0581431e0389d505b to your computer and use it in GitHub Desktop.
Save spuder/1d5c8aee03db4ab0581431e0389d505b to your computer and use it in GitHub Desktop.
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