3 ms·
rebase is git's swiss army chainsaw. i use rebase frequently, but i never remember which direction the operation goes in. do you need to checkout the source br
by shoo 2y ago
rebase is git's swiss army chainsaw.
i use rebase frequently, but i never remember which direction the operation goes in. do you need to checkout the source branch or target branch? truly, it is unknowable. my workflow is to type `man git rebase` and hit space to page through the manual until the first ascii tree surgery diagram appears. then i stare at it until i remember that i need to have checked out my feature branch and am meant to type `git rebase main`. i have trained myself to read the man page every time, perform the operation correctly, then immediately forget.
https://git-scm.com/docs/git-rebase https://git-scm.com/docs/git-rebase
- thriftwy 2y agoThat's why I always use git cherry-pick for specific commits that I want. It's essentially a "cp thing-i-want ." Combined with git reflog your repo becomes as understandable as a floppy disk.
- pjc50 2y agoI use "branch.autosetuprebase=local" and/or --set-upstream-to ; then I can just type "git rebase" while on the thing I want rebased and not have to think about it. (Useful in the gerrit workflow which kind of forces you to have stacks of rebased changes)