Home › Software Dev / Git / GitHub / DevOps / ALM › Creating a New Branch in GitHub from Visual Studio
Software Dev / Git / GitHub / DevOps / ALM · Apr 19, 2019

Creating a New Branch in GitHub from Visual Studio

In this post, we will look at how to create a new branch in GitHub from Visual Studio.

Method 1 – Creating a Branch in GitHub.com

Let’s look at our GitHub repo for out app called my-console-app:

In Visual Studio, we have a project that points to this GitHub repo:

In the bottom right, we see we are connected to the Master branch:

From GitHub, we can create a new branch by clicking on Branch: Master and enter a new branch name:

Enter a name and click Create branch:

We are now in Release1:

Now, if we go to Visual Studio, the new branch won’t be there. We will need to Sync. Press on the Home icon, then Sync:

Double click to make it the current branch:

Let’s update the Release1 branch in VS:

And under Changes, press Commit:

This commits the change locally. Now press Sync to send to GitHub:

And Push:

GitHub is now updated:

Method 2 – Creating a Branch in Visual Studio

Let’s create Release2 in Visual Studio.

We now see:

In GitHub, there is no Release2 branch:

Update the code:

Commit locally:

Note the message. Click Push:

We see success:

In GitHub, we see Release2 created:

 

Leave a Reply

Your email address will not be published. Required fields are marked *

Carl de Souza
KEEP LEARNING. KEEP BUILDING.

Explore AI, agents & Microsoft technology.

I share practical ideas, tutorials, and videos about AI, AI agents, Microsoft technologies, and the Power Platform.