Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dzc34/44e3c2248cea08ac510a to your computer and use it in GitHub Desktop.
Save dzc34/44e3c2248cea08ac510a to your computer and use it in GitHub Desktop.
Git - Récupérer une pull request sans rajouter un nouveau remote
# exemple si la Pull-Request n° 50 a été faite sur la branch X
git checkout origin/X
git checkout -b X
git fetch origin refs/pull/50/head
git merge FETCH_HEAD
# exemple si la Pull-Request n° 50 a été faite sur la branch Y
# mais ce PR aurait du être fait sur la branch X
git checkout origin/X
git checkout -b X
git fetch origin refs/pull/50/head
git checkout FETCH_HEAD
git rebase X
git fetch origin refs/pull/<ID_PULL_REQUEST>/head
git checkout FETCH_HEAD
vim .gitconfig
# [alias]
# chpr = !sh -c 'git fetch origin pull/$1/head:pr/$1 && git checkout pr/$1' -
git chpr <ID_PULL_REQUEST>
@dzc34
Copy link
Author

dzc34 commented Sep 24, 2017

.git/config
"Récupérer une Pull Request (GitHub) ou une Merge Request (Gitlab) en local "
https://borisschapira.com/2016/06/recuperer-pr-mr-en-local/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment