Skip to content

Add flag for using detached HEAD to pr checkout#2117

Merged
samcoe merged 1 commit intocli:trunkfrom
fsmiamoto:checkout-detached-head
Jan 25, 2021
Merged

Add flag for using detached HEAD to pr checkout#2117
samcoe merged 1 commit intocli:trunkfrom
fsmiamoto:checkout-detached-head

Conversation

@fsmiamoto
Copy link
Contributor

@fsmiamoto fsmiamoto commented Oct 7, 2020

The new flag allows for checking out a PR using a detached HEAD, avoiding the creation of additional branches in the local repo.

$ gh pr checkout 123 --detach

Closes #902

@lilyball
Copy link

lilyball commented Oct 8, 2020

Please call this --detach instead of --detach-head; the former already has precedent in the Git CLI (e.g. git checkout --detach refname) so it'll be easier to remember that way.

@fsmiamoto
Copy link
Contributor Author

@lilyball
Good point, I agree.
Renamed to just detach

@vilmibm vilmibm self-requested a review December 18, 2020 22:11
@vilmibm vilmibm assigned vilmibm and samcoe and unassigned vilmibm Jan 19, 2021
@samcoe
Copy link
Contributor

samcoe commented Jan 21, 2021

Thank you for the contribution! I merged in trunk and fixed up the test just a bit. I think this is good to go now 👍

@samcoe samcoe requested a review from mislav January 21, 2021 00:59
@samcoe samcoe force-pushed the checkout-detached-head branch from be6c510 to a3060a5 Compare January 25, 2021 19:17
@samcoe samcoe force-pushed the checkout-detached-head branch from a3060a5 to cec3aa2 Compare January 25, 2021 19:22
@samcoe samcoe merged commit 8125cd5 into cli:trunk Jan 25, 2021
@fsmiamoto fsmiamoto deleted the checkout-detached-head branch February 13, 2021 22:36
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 this pull request may close these issues.

add flag to pr checkout to use detached head

4 participants