Codespaces has been a game changer for the way I work with repos on GitHub. For example, I no longer clone repositories to my local machine since there isn’t a need to do so anymore with Codespaces in the browser.
Last week, while pushing code to update an internal workflow, Codespaces asked me an interesting question. Once I hit enter after my regular
git push, a notification popped up asking if I wanted to open a PR in Codespaces with GitHub’s Pull Request and Issues extension.
Usually, I would completely ignore these pop up messages but I was intrigued enough to select “yes” and what happened next completely blew my mind - ok, ok, slight exaggeration but I was impressed!
This beautifully intuitive UI popped up on my side panel showing me my branch, the main branch that I need to merge my changes into, a title box with my commit message and a description section for my PR needs. There was even an option to create the PR as a draft, see below:
At this point, I was not only intrigued, I was also impressed! You’re telling me that I don’t need to exit my code editor (codespace) to create a PR?!
I continued creating the PR by hitting Create, which triggered a pop-up asking if I wanted to publish my changes in a new upstream branch and then create the PR.
I obliged, clicked Publish Branch, and my PR was created with another pop-up asking if I wanted to periodically run
git fetch. Color me impressed by this extension. Color me impressed.
But, just in case you don’t get that pop-up asking if you want to open a PR, to create a PR in Codespaces, click on the GitHub icon in the editor. This will pull up a side panel option that’s like a Pull Request Dashboard. Once there, click Create Pull Request as shown below, and create your PR!
If you’ve used the extension before in VSCode, you’d already know how to do this and it works the same in Codespaces. What I did appreciate is that this extension built into Codespaces was intelligent enough to ask me if I wanted to use it.
Have you tried this extension before? Or Codespaces? Let me know your thoughts in the comments and give GitHub Pull Request and Issues extensions a try!