![]() ![]() And with toSquash set to true, Git will move the fixup commit to immediately following its target for you. Instead of git commit that could be git commit -fixup=first. update-refs is smart about squashed commits! Say you want to make a fix to the first of several stacked branches # A(main) < goes-before-B < B(first) < C(second-requires-first) < D(third-requires-second) If you're locked into an outdated version because you're using a copy of Git that ships with your OS, you'll need to switch to a copy you manage yourself (for example, Homebrew users can brew install git). ![]() You can use git rebase -update-refs today. But with git rebase -update-refs the solutions are identical □ By adopting git rebase -update-refs you reduce the set of branch management problems you need to have solutions for. But without git rebase -update-refs it is reasonable to think of them as closely related but distinct problems. The "during development" scenario doesn't only happen during development, and the "during review" scenario doesn't only happen during review. Shorter… but requires more knowledge of the context.) A new era # (Or git rebase -onto first first~ third-requires-second. With git rebase -update-refs we can instead run one command git rebase -fork-point -update-refs third-requires-second Git rebase -fork-point second-requires-first third-requires-secondįollowed by pushing first and force pushing ( -with-lease!) second-requires-first and third-requires-second. Or my preference before git rebase -update-refs, git rebase -fork-point: git rebase -fork-point first second-requires-first Git branch -f second-requires-first third-requires-second~ We could run git rebase -onto first first~ third-requires-second To get to the goal A(main) < goes-before-B < B < E(first) < C(second-requires-first) < D(third-requires-second) Which would leave me at A(main) < goes-before-B < B < E(first)Ĭ(second-requires-first) < D(third-requires-second) In the past, I might have added a commit to that branch git checkout first Say a colleague requests a change in the first pull request.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |