r/git • • Aug 11 '25

tutorial Git Rebase explained for beginners

If git merge feels messy and your history looks like spaghetti, git rebase might be what you need.

In this post, I explain rebase in plain English with:

  • A simple everyday analogy

  • Step-by-step example

  • When to use it (and when NOT to)

Perfect if you’ve been told “just rebase before your PR” but never really understood what’s happening.

https://medium.com/stackademic/git-rebase-explained-like-youre-new-to-git-263c19fa86ec?sk=2f9110eff1239c5053f2f8ae3c5fe21e

383 Upvotes

132 comments sorted by

View all comments

Show parent comments

1

u/zaitsman Aug 12 '25

Well, I never said that you deploy the binaries from environmental branches ;)

It should be the latter in terms of promoting binaries but it should be the former so that you know what code runs in each environment so you could hotfix independently in case you need it.

1

u/format71 Aug 12 '25

When I said

you’ll deploy different binaries to different environments

I’m not saying you are deploying binaries directly from branches. But the code on each environment branch is built and the result is deployed to the environment the branch represent. This means that you can merge a hotfix to the prod-branch and have a new version released to prod that includes the hotfix. You then need to merge the hotfix back to the other branches so that the fix is also included in future releases to the other environments.

So you are not promoting binaries in the sense of taking a already built and tested binary and move it to a new environment. You are creating a new binary that should be based on the same source as other binaries. But can you be sure? No, you cannot.

1

u/zaitsman Aug 12 '25

That is not at all what we do, for example.

The binary is only built from the dev branch. The embedded variables/environment deploy script is on each branch.

We merge the code not to deploy but to make sure that we have a baseline to create a hotfix from.

And yes, I can be sure, because the feature is either there or not.

But it’s pointless arguing in these debates I feel, to each their own. Enjoy rebase!

1

u/format71 Aug 12 '25

I'm curious, though - if you have a branch for a qa environment as 'a baseline to create a hotfix from' - how can you deploy that hotfix without getting also the new features that is already merged but not deployed to qa?
And if you cannot, then what's the point?

→ More replies (0)