Skip to content

Prefix branch names when checking out a PR locally#302

Merged
vilmibm merged 2 commits intomasterfrom
co-unique
Feb 5, 2020
Merged

Prefix branch names when checking out a PR locally#302
vilmibm merged 2 commits intomasterfrom
co-unique

Conversation

@vilmibm
Copy link
Contributor

@vilmibm vilmibm commented Feb 4, 2020

This PR changes the behavior of gh pr checkout to always prefix local branch names with
pr/<id>/<branch name>. This prevents branch name collisions locally, which currently result in an
ugly git error.

image

I also took the opportunity to split prCheckout into its own file. I have liked having prCreate split out like that and given how long pr.go has become it seemed like a good idea to split some more.

Closes #233

@vilmibm vilmibm requested review from ampinsk and outofambit February 4, 2020 23:56
Copy link
Contributor

@outofambit outofambit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me! 🚀

noice

@vilmibm vilmibm merged commit d43cdfe into master Feb 5, 2020
@outofambit outofambit deleted the co-unique branch February 5, 2020 18:05
@vilmibm vilmibm mentioned this pull request Feb 5, 2020
3 tasks
@findepi
Copy link

findepi commented Jul 3, 2020

I found this PR when searching for a solution to a problem that gh pr-created branches
(someone else's branches) mix with my own branches, making git branch less useful.
I regret it was reverted (#429).

Stonre pushed a commit to Stonre/strands-fork that referenced this pull request Jul 21, 2025
* feat: Session persistence

* refactor: add pr feedback
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.

Support checkout for PRs whose head matches an unrelated local branch

3 participants