8/18/2023 0 Comments Rebase git![]() Conflicts become messy! Rebase early and often. Regularly fetch and rebase your local branches to stay up-to-date with the main branch.Rebase changes the commit history, and others will not know about it. Do not rebase branches others are working on. While git rebase undoubtedly keeps your commit history cleaner, there are a few things to be mindful of: I only need to know where I started (commit hash 2a2db46). Very nice! It’s cleaner, and looking at my branch history, it’s pretty straightforward to reason about the changes on my branch. In comparison to the earlier example, what does this look like with the same commits “some other thing”, “adding test”, and “addressing comments”? Cleaner commit history with git rebase Use git rebase main, this will complete the rebase, replaying your commits on top of the HEAD of main.Switch back to your branch foo with git checkout foo.This is so we have the latest HEAD of main available for the rebase. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |