Skip to content

Comment on Resistance Against Git Merge Hell (2015)parent

Comments

But that resulted in merge hell until I learned I could just rebase main onto production.

Did you mean rebase production onto main rather? Or do I have my branches and trees mixed up.

I think the commands are:

git checkout production

git rebase main

that gets everything from main into production.

Yes, but rebase is like rebranch. So you take a branch from a tree, and plant it on top of a new tree. So, you rebranch (rebase) production branch on top of the main branch.

git rebase (current branch onto) main

This would rewrite the history for production. Not what you want to do

The point, as I understand it, is that production has no meaningful history separate from main's history: it acts as a bare pointer, and rebasing it just fast-forwards it to later points in main's history.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.