You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
339 B
Bash
21 lines
339 B
Bash
#!/usr/bin/env bash
|
|
#
|
|
# mfadd
|
|
#
|
|
# Add a remote and fetch it
|
|
#
|
|
|
|
[[ $# == 1 ]] || { echo "Usage: `basename $0` user" 1>&2 ; exit 1; }
|
|
|
|
USER=$1
|
|
|
|
MFINFO=$(mfinfo) || exit 1
|
|
IFS=' ' read -a INFO <<< "$MFINFO"
|
|
REPO=${INFO[2]}
|
|
|
|
set -e
|
|
|
|
echo "Adding and fetching $USER..."
|
|
git remote add "$USER" "git@github.com:$USER/$REPO.git"
|
|
git fetch "$USER"
|