When I go to review a PR that cannot be purely evaluated on the code, I click this link:
I've found that to be the most seamless way to check out the branch and give the working app a manual look-see. Otherwise I use the git CLI, but I've found this to be my favorite way so far.
But it seems off to me. I have this app running all the time for this singular purpose. It also seems off because I have to scroll all the way to the bottom of the page and click a text link. If this were the appropriate behavior, it would make sense to me that this button would look a lot more like the "Squash and Merge" button next to it.
I know this has worked for me, but I'm just curious if I'm missing something.
Top comments (13)
Someone else mentioned
hub
github.com/github/hub but thought I'd provide an example! Once you havehub
setup and authenticated with your Github account you can use a command like the following the checkout PR#123 for exampleNot sure if this is easier than the web ui, since you have to find the PR number first, but at least that doesn't require scrolling all the way down the page!
Cool. I have hub installed, I guess I just never used it this way. I'm curious whether the mental overhead of remembering the number and switching applications like that will be the right solution. I do quite like clicking a button, but I'll examine this as an approach.
Now that I'm thinking about it, this might be something I could do entirely in VSCode.
I just installed this, and I will give it a try:
Microsoft / vscode-pull-request-github
GitHub Pull Requests for Visual Studio Code
This extension allows you to review and manage GitHub pull requests in Visual Studio Code. The support includes:
Getting Started
It's easy to get started with GitHub Pull Requests for Visual Studio Code. Simply follow these steps to get started.
GitHub Pull Requests
treeview. On the first load, it will appear collapsed…I use
hub
for this too, all the time. You can also just copy and paste the URL to the GitHub PR page and use that instead of the issue number in thehub checkout <whatever>
command line.This is what I was going to suggest. I absolutely love this extension for this use case. One of my awesome-* repos used to have merge conflicts with basically every PR because of how I initially structured it (an OSS contributor came and restructured it to make this not happen anymore 💖) and this extension saved so much time when I started using it.
That VS Code plugin could likely do what you need. If it does and that is all you use the Github desktop app for I would say replace it. But, if you like working the other way I would say stick with it. It’s hard to argue with the fact that it works and you get your desired results. I don’t think you should consider your approach “wrong” or “inappropriate” because just like most things with development there is multiple ways to get work done and that’s okay.
If it works, it works!
I stopped using GitHub Desktop a while ago because it was oversimplifying some parts of git, which could cause weird errors (typically around merge conflicts, if I recall) and usually required the typical fix. I've since happily used GitKraken, which I find to be a phenomenal git GUI. (Yeah, yeah, not a real programmer, whatevs.)
What do you mean by can not be purely evaluated by reviewing the code? I’ve never used the desktop app. What does clicking that link help you achieve on the app?
If this is what you use to perform manual tests before merging you can just checkout the branch locally on your machine (from the CL) and then execute to test.
I'm not clear on this bit either.
To review PRs, I use what @maestromac showed me, which is running the
git
command:So for example:
I can never remember the full command though so I made it into a
bash
function:Meanwhile, here I am only using Github Desktop at home to clone repos while I use Gitkracken for checking out merge requests haha. I'm starting to get in the habit of using Gitkracken for cloning, too, so I should probably just uninstall Github Desktop. Gitkracken supports multiple web origin types, so it's easier to keep GitLab and GitHub in one spot.
Not sure this is exactly your use case, but I hacked together a way to checkout a PR branch in a local repo by clicking the "Open in Github Desktop" application. It's pretty hacky, but it works:
wuz / open-in-local-git
Use "Open in Github Desktop" to check out the branch in your local repo.
open-in-local-git
Use "Open in Github Desktop" to check out the branch in your local repo.
This is an electron app the overrides the Github desktop application protocol handler to checkout a
git
branch on your local machine when you click the "Open in Github Desktop" link on a Github Pull Request.Inspired by this thread on dev.to
Head over to Releases to download!
If people are interested/this works for them, I'll keep up on the issues and try to add some new features.
There are so many things about git which baffle or confuse me that I'm not sure it fixes more problems than it creates.
Perhaps it is such a small link because the intended way to merge pull requests (according to GitHub) is probably from GitHub Desktop, without the browser step.