Created
January 6, 2017 12:57
-
-
Save tarranjones/e640df8f429a6a2dc1f4e7006b894583 to your computer and use it in GitHub Desktop.
Archives a a git repository in $HOME/{hostname}/{username}/{repository} and optionally creates a symlink to the git directory
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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