4 ms·
Not only ignorance. I don't generally use rebase myself. This is after having some experience with it. I recently had to help a junior un-wedge his local rep
by recursive 2y ago
Not only ignorance. I don't generally use rebase myself. This is after having some experience with it. I recently had to help a junior un-wedge his local repo after an attempted rebase went haywire. I reset to the previous commit and replaced the rebase with a merge. The rest of the lifetime of the branch was uneventful. The problems happened because rebasing changes the identity of commits. When merging that result, commits that have previously been merged create conflicts as they now need to be re-merged under the alias of a different commit hash.
If rebasing works for you, I'm not going to try to sell you something. But there are other ways.
- YZF 2y ago`git reflog`
- recursive 2y agoI use this regularly. Mostly to answer one question. What was the name of that branch I was working on yesterday? Or maybe you're suggesting it as a way to unravel a screwed up rebase. I don't know how to do that. But luckily I do know to abort, reset, and merge.
- YZF 2y agoYes, you can recover from a screwed up rebase or virtually any git problem you created via git commands. You find the commit before you rebased and reset to it. One reference: https://stackoverflow.com/questions/134882/undoing-a-git-rebase https://stackoverflow.com/questions/134882/undoing-a-git-reb...
- recursive 2y agoYes. That's literally what I did.
- account42 2y ago> The problems happened because rebasing changes the identity of commits. When merging that result, commits that have previously been merged create conflicts as they now need to be re-merged under the alias of a different commit hash. And this literally cannot happen in the standard rebase workflow where you have one development branch and then rebase your feature branches on top of that development branch before (fast-forward) merging.