Codespaces Tips: How to Create Pull Requests Without Leaving Your Code Editor
Tags: codespaces, beginners, github, tutorial
Published: 2023-01-25 17:17:16

---
title: Codespaces Tips: How to Create Pull Requests Without Leaving Your Code Editor
published: true
description: create a pull request in codespaces without leaving the cloud editor
tags: #codespaces #beginner #github #tutorial
cover_image: https://user-images.githubusercontent.com/47188731/214456215-287b32af-5109-4cc5-9cbb-4d9be8830993.png
# Use a ratio of 100:42 for best results. 
# published_at: 2023-01-25 20:06 +0000
---
[Codespaces](https://www.youtube.com/watch?v=sYJ3CHtT6WM&list=PL0lo9MOBetEFGPccyxyfex8BYF_PQUQWn&index=14) 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 <kbd>enter</kbd> 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](https://marketplace.visualstudio.com/items?itemName=GitHub.vscode-pull-request-github). 

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!

<img width="100%" style="width:100%" src="https://media.giphy.com/media/xUA7b2KE79co5JD9N6/giphy-downsized.gif">

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](https://user-images.githubusercontent.com/47188731/211912800-5b7c165f-c1c1-4b53-82fd-2ca9541d67a3.png)


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 <kbd>Create</kbd>, 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](https://user-images.githubusercontent.com/47188731/211912598-453dfeca-9cf0-4d8e-990b-334c9233864c.png)

I obliged, clicked <kbd>Publish Branch</kbd>, 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](https://user-images.githubusercontent.com/47188731/211913080-55abe425-75d0-4e2f-95e2-87c4f8ce3413.png)

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 <kbd>Create Pull Request</kbd> as shown below, and create your PR!

![create pr in codespaces](https://user-images.githubusercontent.com/47188731/211915699-f36ee8d4-3576-412a-931f-76894ed2bcf6.png)


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. 
<img width="100%" style="width:100%" src="https://media.giphy.com/media/u8wfPJO1CNx6ZbYWir/giphy.gif">


Have you tried this extension before? Or Codespaces? Let me know your thoughts in the comments and give [GitHub Pull Request and Issues extensions](https://marketplace.visualstudio.com/items?itemName=GitHub.vscode-pull-request-github) a try!



Happy Coding!