dotfiles/.local/bin/scripts/git-fork
2021-10-11 10:02:14 +02:00

13 lines
352 B
Bash
Executable file

#!/bin/sh
# Clones a fork and sets a corresponding upstream
# ARGS
# - repo name
# - upstream user
# - local user
# - url
# - target directory name (and further arguments to clone)
set -e
git-get "${4:-github.com}" "$1" "$3" "${@:5}"
cd $(expr "$5" \| "$1")
test "$2" && git remote add upstream "$(git-repo "${4:-github.com}" "$1" "$2")"
git remote -v