Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Archives a a git repository in $HOME/{hostname}/{username}/{repository} and optionally creates a symlink to the git directory
archive_repo(){
mkdir -p ~/$1
if ! git -C ~/$1 pull; then
git clone https://$1.git ~/$1
fi
if [ ! -z "$2" ]; then
mkdir -p $2
rm -rf $2
ln -s ~/$1 $2
fi
}
@tarranjones

This comment has been minimized.

Copy link
Owner Author

@tarranjones tarranjones commented Jan 6, 2017

Usage

$ archive_repo github.com/zsh-users/antigen .antigen

PhpStorm Framework Integration

$ archive_repo github.com/wordpress/wordpress
$ archive_repo github.com/joomla/joomla-cms
$ archive_repo github.com/drupal/drupal

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment