Refined-github: Can RG recommend me the command to fetch a PR locally?

Created on 9 Feb 2020  路  9Comments  路  Source: sindresorhus/refined-github

Sometimes you want to pull a PR locally to test and it's really some work when you have to do something like

git fetch remote_name pull/PR_No/head:Branch_name
Eg:
git fetch origin pull/1234/head:pr-1234

Read more at: https://blog.scottlowe.org/2015/09/04/checking-out-github-pull-requests-locally/

Can Refined Github suggest the command itself by doing the hard work of sorting the PR_No and Branch_name itself?

I think it's also possible to suggest a remote_name too by checking if the username of user matches the owner of the repo.

Example: https://github.com/substack/browser-launcher/pull/35

enhancement good first issue help wanted

Most helpful comment

Honestly I would suggest this to GitHub themselves; this text should be added by them:

However I wouldn't mind adding a couple of "click to pull" buttons on all PRs (also replacing that text on PRs you can merge):

  • one button copies hub pull $url
  • the other button is a GitHub Desktop link, like the one appearing above

All 9 comments

GitHub does it already, check the links near the Merge button. Or just use hub cli tool

@fregante That Github option is only for the owner of repo who has merge access, I am asking it for people who don't have merge access but still want to help by reviewing the PR. I think that's the whole point of Open Source. I don't want to use hub cli that's why I requested it.

Indeed, reopening a little longer for discussion, however the point of hub is to avoid repetitive actions like this. Why not use an existing tool that does the job better?

It's not a bad idea to integrate it in Refined-Github itself, I guess. The second thing is newcomers don't always know the tools like hub (Thanks for suggesting it to me). When I wanted to fetch a PR from someones's repo, I googled and it gave me the above article which explains the normal way instead of suggesting hub which does the job better. (a newbie perspective) I'm sure must be pro devs who don't know about hub too and want to contribute to Open source, this can simplify that.

Honestly I would suggest this to GitHub themselves; this text should be added by them:

However I wouldn't mind adding a couple of "click to pull" buttons on all PRs (also replacing that text on PRs you can merge):

  • one button copies hub pull $url
  • the other button is a GitHub Desktop link, like the one appearing above

There鈥檚 also an alternative UI to consider/copy, maybe we don鈥檛 need this feature at all, GitHub is already working on it. We just need to tell them to add it on PRs you can鈥檛 merge. Did you contact them?

https://twitter.com/_developit/status/1227325361517744128?s=20

I'll try contacting them.

That Github option is only for the owner of repo who has merge access

GitHub finally added this for everyone :tada:

No "classic git" commands however, they're only in the mergeability box.

We might even undo https://github.com/sindresorhus/refined-github/pull/2553 at some point

PR welcome to add a third tab in that dropdown with instructions to fetch the PR with the ability to push to that origin. The dropdown only exists for maintainers, so it makes sense to include that ability.

I think the command is this, but exploration needed:

git remote add fregante https://github.com/fregante/refined-github.git
git checkout fregante/branch-of-this-pr
Was this page helpful?
0 / 5 - 0 ratings

Related issues

hkdobrev picture hkdobrev  路  3Comments

fregante picture fregante  路  3Comments

pawelad picture pawelad  路  3Comments

durka picture durka  路  3Comments

shivapoudel picture shivapoudel  路  3Comments