Last active
December 22, 2018 22:35
-
-
Save glallen01/b48cfa2c929efa905553309215f68e9d to your computer and use it in GitHub Desktop.
zsh to fetch a remote fork as a a branch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# todo, this substitution only works with zsh, and passing shell functions doesn't seem to work with parallel | |
# usage gfr https://github.com/user/fork.git | |
gfr() { git remote add ${${1%/*}##*/} $1; git fetch ${${1%/*}##*/} master:${${1%/*}##*/}; } | |
export -f gfr | |
function curl -v -H "Authorization: token ${GITHUBAPIKEY}" https://api.github.com/repos/${GITUSER}/${GITREPO}/forks | | |
jq '.[].clone_url' | | |
sed "s/\"//g" | | |
parallel -j 1 ./gfr ::: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment