Skip to content

Instantly share code, notes, and snippets.

@zhigang1992
Last active December 14, 2015 06:39
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 zhigang1992/5044466 to your computer and use it in GitHub Desktop.
Save zhigang1992/5044466 to your computer and use it in GitHub Desktop.
Clone Git Repos with Alfred.
cd ~/Temp;
IFS='/' read -a array <<< "{query}";
folder=`echo ${array[${#array[@]}-1]} | cut -d \. -f 1`
if [ ! -d $folder ]; then
git clone "{query}";
cd `echo $folder`;
open .;
else
cd `echo $folder`;
git pull origin master;
open .;
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment