Skip to content

Instantly share code, notes, and snippets.

@lanefu
Created November 3, 2024 11:27
Show Gist options
  • Save lanefu/b3ab6d18820886a4ac1cfb6b204ff729 to your computer and use it in GitHub Desktop.
Save lanefu/b3ab6d18820886a4ac1cfb6b204ff729 to your computer and use it in GitHub Desktop.
Git checkout pull request from GitHub
#!/bin/bash
REMOTE_REPO=origin
PR=${1}
git fetch -v ${REMOTE_REPO} +refs/pull/${PR}*:refs/remotes/${REMOTE_REPO}/pull/${PR}*
git checkout -f ${REMOTE_REPO}/pull/${PR}/merge
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment