![]() ![]() ![]() Merge commit has all tangled lines plus an extra commit, Squash is a straight line but loses the history so here comes Rebase, which keeps the history AND the straight line AND doesn’t require an extra commit for the merge.ĭoes this make Rebase the best strategy ever? Well… actually not necessarily, because it has some potentially destructive side effects. RebaseĪ third way is that you don’t really need a commit that indicates a merge took place, and you still want to end up having all commits in a single, straight line. ![]() Who doesn’t like squash merge, usually brings the fact that you’re losing a lot of commit history, but it’s up to you if you think commits on a branch are valuable when reviewing old activity or rather is just noise. When squashing a merge, the result is that you get rid of all commits on the branch and only add a single commit on main with all the content.Īs a result, the history is much cleaner and while working on a branch you can do all the commits you want, since you know that with the squash all your sins will be forgotten. The question is, do you really need to keep track of every single commit? Including typos, missing files, formatting… if the answer is no, then you should consider Squash merge. The downside is that when multiple commits are on multiple branches, the history quickly become really tangled and following the path of a change can be quite a challenge. The biggest advantage is that you can easily track down the exact commit where a line has been modified, as long as there aren’t too many commits. The history of all your commits remains untouched and on the main branch you see an additional commit that merges all your branch content. Merge commit is probably the most common as it’s the default option on GitHub and also the default behaviour when you manually use git merge. In the video I will go in detail about the three strategies, and I will also do a “live demo” with GitHub stickers and JS pins, if you’re curious I’d recommend you to watch the video, otherwise you can find the full text content here below. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |