config/git: move git-fork to script
This commit is contained in:
parent
63c7a24788
commit
bfcaeb7436
|
@ -80,13 +80,6 @@ project() {
|
|||
fi
|
||||
}
|
||||
|
||||
gitfork() {
|
||||
builtin cd "$projects_dir/_forks"
|
||||
gitclone github.com "$1" "" "$3" --recurse-submodules || return $?
|
||||
test "$2" && git remote add upstream "$(gitremote github.com "$1" "$2")"
|
||||
git remote -v
|
||||
}
|
||||
|
||||
# }}}
|
||||
|
||||
# Rewriting history {{{
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
#!/bin/sh
|
||||
# Clones a fork and sets a corresponding upstream
|
||||
# Args:
|
||||
# - repo name
|
||||
# - upstream user
|
||||
# - local user
|
||||
# - target directory name
|
||||
set -e
|
||||
git-get github.com "$1" "$3" "${@:4}"
|
||||
test "$2" && git remote add upstream "$(gitremote github.com "$1" "$2")"
|
||||
git remote -v
|
|
@ -1,6 +1,6 @@
|
|||
#!/bin/sh
|
||||
# Clones from resolving the arguments and switches into the new directory
|
||||
remote=$(gitremote "$@")
|
||||
echo $remote
|
||||
git clone $remote ${@:4} || return $?
|
||||
remote=$(git-repo "$@")
|
||||
echo "Cloning $remote"
|
||||
git clone $remote ${@:4} --recurse-submodules || return $?
|
||||
cd "$(test $4 && echo $4 || basename ${remote%.git})"
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
#!/bin/sh
|
||||
# Push HEAD to a new branch in origin
|
||||
git push origin "HEAD:$1"
|
Loading…
Reference in New Issue