Marge a Git Branch to a Master Branch

In this blog post, I will show you how to marge a git repository branch to a master branch.

Create a Branch

I will start by creating a new branch called Dev using the following command.

git branch Dev

After creating the new branch, I will check it out and add files to it.

git checkout Dev
Nano file4.ps1
git add .

After adding the files, I will commit it.

git commit -m "Add file4.ps1"

Marge

To marge the Dev branch, I will start by checking out the master branch.

git checkout master

Now, I can marge the Dev branch to the master branch with the following command.

git marge Dev

To delete the Dev branch, I will run the following command.

git branch -d Dev

Processing…
Success! You're on the list.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.