git Force Push
Rebasing is a frequent task for anyone using git. We sometimes use rebasing to branch our code from the last changes or even just to drop commits from a branch.
Oftentimes when trying to push after a rebase, you'll see something like the following:
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
Commonly developers will use the --force or -f flags during a push to force pushing code changes:
git push origin my-branch --force
# or
git push origin my-branch -f
I was recently surprised to find out that you could also prefix the branch name with + to force a push:
git push origin +my-branch
The + syntax is interesting but doesn't seem intuitive so it's not a practice I'd use, but that doesn't mean you shouldn't!
![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...
![Welcome to My New Office]()
My first professional web development was at a small print shop where I sat in a windowless cubical all day. I suffered that boxed in environment for almost five years before I was able to find a remote job where I worked from home. The first...
![jQuery Chosen Plugin]()
Without a doubt, my least favorite form element is the SELECT element. The element is almost unstylable, looks different across platforms, has had inconsistent value access, and disaster that is the result of multiple=true is, well, a disaster. Needless to say, whenever a developer goes...
![Simple Image Lazy Load and Fade]()
One of the quickest and easiest website performance optimizations is decreasing image loading. That means a variety of things, including minifying images with tools like ImageOptim and TinyPNG, using data URIs and sprites, and lazy loading images. It's a bit jarring when you're lazy loading images and they just...
Thanks for the tip about the prefix, this is an interesting shortcut!
In most cases the
--force-with-leaseoption seems safer in case there are some additional commits as well: https://git-scm.com/docs/git-push#Documentation/git-push.txt—no-force-with-lease