Last active
February 6, 2023 15:04
-
-
Save dzc34/44e3c2248cea08ac510a to your computer and use it in GitHub Desktop.
Git - Récupérer une pull request sans rajouter un nouveau remote
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
.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/