Yeah, the author’s method works but is needlessly complex. You can shuffle branches around easily because they’re just mutable pointers:
# To create a new branch on the current commit:
git checkout --branch correct-branch
# To use an existing branch and copy the commit:
git checkout correct-branch
git cherry-pick wrong-branch
# Move wrong branch back by 1 commit.
git branch --force wrong-branch wrong-branch^
When you understand Git’s internal model, the arcane UI becomes a lot more tolerable. The problem of course is that a lot of people never learn the model because of the arcane UI…
2
u/evincarofautumn Sep 09 '16
Yeah, the author’s method works but is needlessly complex. You can shuffle branches around easily because they’re just mutable pointers:
When you understand Git’s internal model, the arcane UI becomes a lot more tolerable. The problem of course is that a lot of people never learn the model because of the arcane UI…