dotfiles/.local/bin/scripts/git-fork

12 lines
305 B
Text
Raw Normal View History

2021-06-19 21:24:14 +02:00
#!/bin/sh
# Clones a fork and sets a corresponding upstream
# Args:
# - repo name
# - upstream user
# - local user
2021-10-08 12:31:00 +02:00
# - target directory name (and further arguments to clone)
2021-06-19 21:24:14 +02:00
set -e
git-get github.com "$1" "$3" "${@:4}"
2021-10-08 12:31:00 +02:00
test "$2" && git remote add upstream "$(git-repo github.com "$1" "$2")"
2021-06-19 21:24:14 +02:00
git remote -v