This repository has been archived on 2022-01-28. You can view files and clone it, but cannot push or open issues or pull requests.
Marlin-Artillery-M600/buildroot/share/git/mfadd
Scott Lahteine 78308b1c0b New git helper scripts 'mfadd' and 'mfqp'
- `mfadd` adds and fetches a user’s fork of Marlin
- `mfqp` invokes `git commit -m`, `mfrb`, `git push -f`
2017-04-20 21:37:25 -05:00

24 lines
361 B
Bash
Executable file

#!/usr/bin/env bash
#
# mfadd
#
# Add a remote and fetch it
#
MFINFO=$(mfinfo) || exit
IFS=' ' read -a INFO <<< "$MFINFO"
REPO=${INFO[2]}
OLDBRANCH=${INFO[4]}
case "$#" in
1 ) USER=$1 ;;
* ) echo "Usage: `basename $0` [user]" 1>&2 ; exit 1 ;;
esac
set -e
echo "Adding and fetching $USER..."
git remote add -f "$USER" "git@github.com:$USER/$REPO.git"