Let's understand it by example:
Query: I created a feature branch upgrade10.4, from develop 3 months ago and worked on it. On develop, the team was working on sitecore 9.3 specific code. After completing the upgrade work on feature branch now I want to sync all the changes that were going parallelly, on the develop, with upgrade 10.4 to get all the changes of develop on my feature. How can I rebase it?
Solution: ✅ Correct Mental Model (Very Important)
-
develop→ has latest business changes, but 9.3-specific upgrade10.4→ has upgrade changes, but missing last 3 months of develop work
upgrade10.4 onto developQuery: Doesn't it sounds odd that re base feature branch onto develop, where onto sounds like we are migrating changes from feature to develop.
The Precise Meaning of “rebase X onto Y”
Rebase X onto Y means
👉 Take the commits from X and replay them on top of Y
It does NOT mean:
-
merging X into Y
-
moving changes from X to Y
-
modifying Y at all
Only X changes, Y stays untouched.
BEFORE:
A---B---C---D develop (Sitecore 9.3 work)
\
E---F---G upgrade10.4 (your feature work)
developcontinued withC-Dupgrade10.4branched atBand addedE-F-G
Command You Run
- git checkout upgrade10.4
- git rebase develop
This literally means:
“Take commits E-F-G and replay them as if they were created after D.”
AFTER REBASING:
A---B---C---D---E'---F'---G' upgrade10.4
^
develop (unchanged)
Important:
-
developdoes not move -
upgrade10.4changes base -
Your commits are copied, not moved
Why the Word “onto” Is Misleading
Natural language suggests:
“Put feature onto develop”
But Git language means:
“Put feature commits on top of develop”
A better mental phrasing is:
“Rebase feature so that it sits on develop”
Rebase does exactly that, but in a clean, linear way:
-
You get all develop changes
-
Your upgrade commits appear last
-
History looks like upgrade happened after latest develop
https://sitecorepeanuts.blogspot.com/2025/12/what-is-rebasing.html
ReplyDelete