sindresorhus/refined-github

Strip username when copying branch name #2446

keith posted onGitHub

Currently when using the copy button beside a branch name on a pull request from a forked repo, you end up copying something like user:branch. This makes it difficult to checkout the branch locally since you have to manually strip the user: from the string. It would be great if refined github did that for you!

image

Example URL: https://github.com/bazelbuild/rules_apple/pull/606


We suggest using hub, GitHub Desktop or following the instructions at the bottom of the page instead (currently hidden though https://github.com/sindresorhus/refined-github/issues/963)

posted by fregante over 5 years ago

Thanks for the suggestion, IMO that's a bit heavy handed to fix this so I think I'll write my own checkout wrapper to handle this

posted by keith over 5 years ago

Out of curiosity, can you show me how you check out a PR step by step? For me it's:

  1. Copy the page's URL
  2. Press <kbd>h</kbd> <kbd>ā†’</kbd> in the terminal (usually autocompletes to hub checkout (pbpaste))
  3. Press <kbd>enter</kbd>

This works with any PR, regardless of the PR's origin (mine? previously checked out?)

If I'm already on GitHub Desktop, in 3 clicks:

  1. Open the branch list
  2. Switch to PR list if it isn't already
  3. Select the PR from the list

Both of these pull and checkout the branch in one go.

posted by fregante over 5 years ago

For me it's:

  1. Click the branch copy
  2. Type g co cmd v
  3. Enter

This doesn't support all the cases yours does but it works for my workflow. I'm just not using hub there

posted by keith over 5 years ago

Fund this Issue

$0.00
Funded

Pull requests