One of my least favorite tasks as a software engineer is resolving merge conflicts. A simple rebase is a frequent occurrence but the rare massive conflict is inevitable when many engineers work in a single codebase. One thing that helps me deal with large rebases with many merge conflicts is flattening a branch’s commits before fixing merge conflicts. Let’s have a look at how to flatten those commits before resolving those conflicts!
My typical command for rebasing off of the main branch is:
# While on the feature branch... git rebase -i master
To flatten commits before the rebase, which can make resolving merge conflicts easier, you can slightly modify the original command:
# While on the feature branch... # git rebase -i HEAD~[NUMBER_OF_COMMITS] git rebase -i HEAD~10
The example above would flatten the last 10 commits on the branch. With just one single commit, you avoid the stop-start nature of fixing merge conflicts with multiple commits!
CSS Filters
CSS filter support recently landed within WebKit nightlies. CSS filters provide a method for modifying the rendering of a basic DOM element, image, or video. CSS filters allow for blurring, warping, and modifying the color intensity of elements. Let’s have…
CSS Sprites
The idea of CSS sprites is pretty genius. For those of you who don’t know the idea of a sprite, a sprite is basically multiple graphics compiled into one image. The advantages of using sprites are: Fewer images for the browser to download, which means…
Source link