4 ms·
Git is many tools. For the purpose of this discussion it’s at least the following 2 tools: 1. A source code control system which allows you to manage the histo
by rhaway84773 4y ago
Git is many tools. For the purpose of this discussion it’s at least the following 2 tools:
1. A source code control system which allows you to manage the history and branches of your code.
2. A source code collaboration system that allows you to share code with others.
git rebase is excellent for (1). It could also be considered fundamental to it. I know I certainly use it a ton for this purpose and would find myself lost without it.
Unfortunately git rebase completely breaks (2) and if all git was is (2) it would certainly be considered an anti-feature, if not a bug.
- FridgeSeal 4y ago> Unfortunately git rebase completely breaks (2) I’m not sure I follow the logic? What is it about rebase that makes sharing difficult? Isn’t rebase just a merge strategy? And if you have code in a branch, and you share that, it doesn’t matter about the merge strategy? Or am I missing knowledge/misunderstanding something?
- rhaway84773 4y agoRebase is a lot more than a merge strategy. Merging is only one of the things it can do. Rebase -i allows you to rewrite history, and if you rewrite history of shared code, it leads to all sorts of issues with git.
- FridgeSeal 4y agoWell, TIL, thanks for that. I’ve only ever used rebase in the very plain and not interactive mode of “please just apply my changes back on top of the incoming upstream changes” which does none of the history rewriting haha.
- pmeunier 4y agoAnother use of rebase is cherry-picking commits, which is also plagued with all sorts of issues. These aren't "bugs", since the issue is that commits aren't really suitable for doing this: patches (like in Pijul or Darcs) do solve this.