Skip to content

Instantly share code, notes, and snippets.

@network23
Created March 22, 2017 11:27
Show Gist options
  • Save network23/c95fb2bfaf904b7889720d090eba1069 to your computer and use it in GitHub Desktop.
Save network23/c95fb2bfaf904b7889720d090eba1069 to your computer and use it in GitHub Desktop.
This script will clone a github repository and register it with myrepos.
#!/bin/bash
# This script will clone a github repository and register it with myrepos.
#
# How to use:
# You need myrepo's and git. If you are using Debian/Ubuntu/Mint: sudo apt install -y myrepos git
# chmod +x mrgitclone.sh
# An alias is recommended, if you are using bash and the script is in your home dir: echo "alias mrgitclone='~/mrgitclone.sh'" >> ~/.bash_aliases
# ./mrgitclone.sh https://github.com/name/project.git
#
# To update all your github repositories: mr update
#
url=$1
if [ "$url" = "" ]; then
echo "check die url swa"
exit
fi
git clone $url
prognaam=$(basename --suffix=.git $url)
mr reg $prognaam
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment