Git Branching, Pull, Merge, Commit, and Push
dev.to·2d·
Discuss: DEV
🌿Git
Preview
Report Post

In this post, I’ll walk you through how to create a Git branch from a parent branch, pull the latest changes, commit your code, push it to the remote repository, merge branches, and finally make sure everything stays up to date. I’ll explain each step in a simple and practical way.

Let’s get started 🚀

1️⃣ Switch to the Parent Branch and Fetch Latest Changes

First, move to the parent branch (usually main or develop) and fetch the latest updates from the remote repository.

git checkout branch-name
git fetch origin


Now pull the latest changes to make sure your parent branch is up to date:

git pull origin branch-name

2️⃣ Create a New Branch from the Parent Branch

Once your parent branch is updated, create a new feature branch from it:

git checkout -b new_bra...

Similar Posts

Loading similar posts...

Keyboard Shortcuts

Navigation
Next / previous item
j/k
Open post
oorEnter
Preview post
v
Post Actions
Love post
a
Like post
l
Dislike post
d
Undo reaction
u
Recommendations
Add interest / feed
Enter
Not interested
x
Go to
Home
gh
Interests
gi
Feeds
gf
Likes
gl
History
gy
Changelog
gc
Settings
gs
Browse
gb
Search
/
General
Show this help
?
Submit feedback
!
Close modal / unfocus
Esc

Press ? anytime to show this help