Git Basics: Merging Branches & Deleting Them (Local + Remote)
In this video, you’ll learn how to merge your feature branch back into the master branch once your code is ready, and how to safely delete branches both locally and on the remote repository.
We’ll walk through switching to the master branch, pulling the latest changes, merging your feature branch, pushing the updates to GitHub, and then cleaning up unnecessary branches. This is an essential step in maintaining a clean and organized Git workflow.
📌 What You’ll Learn in This Video
0:00 – Welcome & Introduction
0:05 – Why & When to Merge a Branch into Master
0:12 – Switching to the Master Branch (`git checkout master`)
0:25 – Pulling the Latest Changes (`git pull origin master`)
0:52 – Checking Merged Branches with `git branch --merged`
1:07 – Merging Feature Branch into Master (`git merge branch_name`)
1:19 – Pushing Merged Code to GitHub (`git push origin master`)
1:38 – Verifying Changes on GitHub
1:56 – Checking Again Which Branches are Merged
2:21 – Deleting a Local Branch (`git branch -d branch_name`)
2:40 – Confirming Local Deletion with `git branch -a`
2:54 – Deleting the Branch from Remote (`git push origin --delete branch_name`)
3:17 – Final Verification: Only Master Branch Remains
3:25 – Review of Merge & Delete Workflow
Related Links:
Course: https://www.becloudready.com/devops-l...
Land a DevOps Job in 60 Days: https://www.becloudready.com/post/dev...
Subscribe for more DevOps and software development tutorials: / @becloudready
Follow For More on Social Media:
Instagram: / becloudready
Facebook: / becloudready
X: https://x.com/becloudready
LinkedIn: / becloudready