Skip to content

Instantly share code, notes, and snippets.

@myobie
Created November 23, 2020 09:10
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 myobie/956786ea0ae984c69f02cdfa51a13ae0 to your computer and use it in GitHub Desktop.
Save myobie/956786ea0ae984c69f02cdfa51a13ae0 to your computer and use it in GitHub Desktop.
Keep things organized with a clone bash function which always puts repos into the correct place
clone() {
org=$(echo $1 | awk -F/ '{ print $1 }')
mkdir -p ~/src/github.com/$org
path=~/src/github.com/$1
git clone $@ $path
cd $path
}
# Examples:
# $ clone myobie/dot-files
# $ clone rails/rails
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment