In this blog post, I will show you how to merge 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
![](https://ntweekly-3e2e1f4957bdf35452c0-endpoint.azureedge.net/blobntweekly18036ad1fb/wp-content/uploads/2020/06/060320_2323_MargeaGitBr1.png)
After creating the new branch, I will check it out and add files to it.
git checkout Dev
Nano file4.ps1
git add .
![](https://ntweekly-3e2e1f4957bdf35452c0-endpoint.azureedge.net/blobntweekly18036ad1fb/wp-content/uploads/2020/06/060320_2323_MargeaGitBr2.png)
After adding the files, I will commit it.
git commit -m "Add file4.ps1"
![](https://ntweekly-3e2e1f4957bdf35452c0-endpoint.azureedge.net/blobntweekly18036ad1fb/wp-content/uploads/2020/06/060320_2323_MargeaGitBr3.png)
Merge
To merge the Dev branch, I will start by checking out the master branch.
git checkout master
Now, I can merge the Dev branch to the master branch with the following command.
git merge Dev
To delete the Dev branch, I will run the following command.
git branch -d Dev
Processing…
Success! You're on the list.
Whoops! There was an error and we couldn't process your subscription. Please reload the page and try again.