#!/bin/bash

ITEM="$1"
ROOT="$HOME/repo/out"
ITEM_PATH="$ROOT/$ITEM"

git clone $ITEM_PATH

#!/bin/bash

ITEM="$1"
ROOT="$HOME/repo/out"
MIRROR="$ROOT/$ITEM"

ITEM_TAIL=$(echo "$ITEM" | tr "/" "\n" | tail -n 1)

git clone $MIRROR

ORIGIN=$(cd $MIRROR && git remote get-url origin)
$(cd $ITEM_TAIL && git remote set-url origin "$ORIGIN")
$(cd $ITEM_TAIL && git remote add mirror "$MIRROR")

Add ability to set remotes: origin, mirror
Add ability to set remotes: origin, mirror
