Skip to content

Instantly share code, notes, and snippets.

@qtopie
Last active November 5, 2018 09:52
Show Gist options
  • Save qtopie/840020d800d8c6a98c217e8c0dee4d8c to your computer and use it in GitHub Desktop.
Save qtopie/840020d800d8c6a98c217e8c0dee4d8c to your computer and use it in GitHub Desktop.
Script to get added commit ids of pull request
#!/bin/bash
REPO_DIR=/tmp/my-git-repo
git clone -b $SOURCE_BRANCH $SOURCE_REPO_URL $REPO_DIR && cd $REPO_DIR || exit 1
git remote add upstream $TARGET_REPO_URL && git fetch upstream $TARGET_REPO_BRANCH
commit_ids=$(git cherry upstream/$TARGET_REPO_BRANCH | awk '{print $2}')
cd -
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment