Skip to content

Instantly share code, notes, and snippets.

@wsanchez
Last active January 4, 2017 21:19
Show Gist options
  • Save wsanchez/87d1d9d0ccaddb074de3f8313decedf5 to your computer and use it in GitHub Desktop.
Save wsanchez/87d1d9d0ccaddb074de3f8313decedf5 to your computer and use it in GitHub Desktop.
#!/bin/sh
set -e
set -u
# Too lazy for proper options parsing
PR_NUMBER="$1"; shift;
TICKET_NUMBER="$1"; shift;
BRANCH_NAME="$1"; shift;
#repo="https://github.com/twisted/twisted.git";
repo="git@github.com:twisted/twisted.git";
clone="$(mktemp -d -t twisted)";
git clone --progress "${repo}" "${clone}";
cd "${clone}";
git fetch origin "refs/pull/${PR_NUMBER}/head";
git push origin "FETCH_HEAD:refs/heads/${TICKET_NUMBER}-${BRANCH_NAME}";
rm -fr "${clone}";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment