Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: git pr to checkout merge commit instead of HEAD #757

Closed
gormac opened this issue Jun 6, 2019 · 4 comments · Fixed by #762
Closed

Feature request: git pr to checkout merge commit instead of HEAD #757

gormac opened this issue Jun 6, 2019 · 4 comments · Fixed by #762

Comments

@gormac
Copy link

gormac commented Jun 6, 2019

I'd like git pr 9999 [upstream] to (optionally) checkout a merge commit against the branch the pull request is targeting rather than checking out HEAD. This allows me to locally test the actual result of the pull request.

@spacewander
Copy link
Collaborator

Do you mean checking out the merge commit created by merging the pull request into the current branch?
Could you submit a pull request to update the documentation, so that we could understand how this new feature should work?

BTW, I am too busy in the upcoming weeks. Please forgive me if I don't reply in time.

@gormac
Copy link
Author

gormac commented Jun 6, 2019

Similar to checking out HEAD my local git alias for checking out the merge commit to the target branch is:

git fetch -fu upstream refs/pull/$id/merge:pr/$id && git checkout pr/$id

So, head becomes merge and that's it. Changing it would be a breaking change though, so maybe it could just be a new command complementary to git pr. Something like:

git prm 9999 [upstream]

@spacewander
Copy link
Collaborator

@gormac
Can you check if the #762 works for you? You can install the latest git-extras via source: https://github.com/tj/git-extras/blob/master/Installation.md#building-from-source

@gormac
Copy link
Author

gormac commented Jun 17, 2019

@spacewander Adding a merge option to git pr would certainly do the trick. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants