Skip to content

Instantly share code, notes, and snippets.

@nictuku
Created June 26, 2018 22:12
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 nictuku/f3d0695604399ee873a7e26e43ba0ed5 to your computer and use it in GitHub Desktop.
Save nictuku/f3d0695604399ee873a7e26e43ba0ed5 to your computer and use it in GitHub Desktop.
#!/bin/bash
function clone() {
repo=$1 # https://github.com/fatih/vim-go.git
dest=$2 # ~/.vim/pack/plugins/start/vim-go
mkdir -p $dest
cd $dest
git init
if ! git config remote.origin.url &> /dev/null;then
git remote add origin $repo
fi
git fetch origin master
git reset origin/master # --hard to wipe everything but that's dangerous
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment