DEV Community

Cover image for Codespaces Tips: How to Create Pull Requests Without Leaving Your Code Editor
Kedasha for GitHub

Posted on

Codespaces Tips: How to Create Pull Requests Without Leaving Your Code Editor

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:

Pull Request dashboard in Codespaces

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.

no upstream branch create one

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.

periodically run git fetch pop-up

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!

create pr in codespaces

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.

I’m super glad I clicked yes on that pop-up notification instead of ignoring it. It just goes to show that sometimes, pop-ups can be useful.

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!

Happy Coding!

Top comments (5)

bigfidelis profile image
Oluborode Akintunde Paul

With Vscode extension it's easier, but you need to understand how this works on command line (don't be lzy) lol

blackgirlbytes profile image
Rizèl Scarlett

It's okay to show various options on how to do version control.

ladykerr profile image

hahaha, with so many ways to open a PR on GitHub who needs the command line 🤪 lol

bigfidelis profile image
Oluborode Akintunde Paul

on console, feels traditional. 😎.. Maybe Ai should be integrated to Vscode (with voice action GIT PUSH 😆)

Thread Thread
blackgirlbytes profile image
Rizèl Scarlett

They have GitHub Copilot for CLI though