06 Git Branch for Beginners

Опубликовано: 14 Июнь 2026
на канале: AiCE Community
No
0

In this Git and GitHub tutorial for beginners, you will learn how Git branches work, how to create and switch branches, how to push branches to GitHub, understand commits, Ahead and Behind status, and how to merge branches into the main branch.

Branches are one of the most important features in Git because they allow developers to work on new features, bug fixes, and experiments without affecting the main project. In this practical step-by-step tutorial, we create a new branch, push it to GitHub, make changes inside the branch, compare commit histories, and finally merge the branch back into the main branch.

Whether you are new to Git or preparing for software engineering projects, this lesson will help you understand real-world Git workflows used by professional developers.

⏱️ TIMESTAMPS

00:00 Introduction
00:38 Understanding Git Branches
02:36 Viewing Branches on GitHub
03:08 Checking Branches in the Terminal
03:46 Creating a New Branch
04:38 Switching Between Branches
05:40 Pushing a New Branch to GitHub
07:04 Creating Files Inside a Branch
08:12 Add, Commit, and Push in a Branch
09:16 Why Changes Don't Appear in Main Branch
10:28 Understanding Branch Isolation
12:22 Commit History and Branch Comparison
13:35 Understanding Ahead and Behind
15:57 Why Commit Count Is Different From File Count
17:20 Creating Multiple Files in a Branch
18:20 Pushing Additional Changes
19:02 Merging a Branch into Main
19:55 Pushing the Merged Changes to GitHub
20:28 Verifying the Merge on GitHub

📚 What You Will Learn

✅ What a Git branch is
✅ Why developers use branches
✅ Difference between main branch and feature branches
✅ How to create a branch with git branch
✅ How to switch branches with git switch
✅ How to push a branch to GitHub
✅ Understanding commit history
✅ Understanding Ahead and Behind status
✅ Why commits are different from files
✅ How to merge branches using git merge
✅ How to update GitHub after merging

💻 Commands Used

git branch

git branch food

git switch food

git push --set-upstream origin food

git add .

git commit -m "commit message"

git push

git switch main

git merge food

📌 Playlist: Git and GitHub for Beginners

If you are following this series from the beginning, make sure you watch the previous lessons before continuing.

👍 Like the video
💬 Leave your questions in the comments
🔔 Subscribe for more Software Engineering tutorials

#Git #GitHub #GitBranches #GitMerge #SoftwareEngineering #Programming #Developer #CodingTutorial #GitTutorial #GitHubTutorial #LearnGit #VersionControl #WebDevelopment #BeginnerProgramming #AfricaToTheWorld