Reset a Branch to Remote State with git
Every once in a while I accidentally hose my repository's master branch by merging or committing something I shouldn't. And then on rare occasion I push that to my remote and then things get all sorts of messed up. Every PR from that point on has some wonky commits and I look like a noob. Sometimes the best course of action is to just reset to the a remote branch's master (i.e. the repository I forked the project from) and get on with life that way. Here's how to do so:
git fetch some-remote # "origin" if you want to use your own branch
git reset --hard some-remote/master
The first step is fetching a list of branches from the remote. The next is executing a hard reset of the branch based on the remote.
Now you can stop asking yourself how things got so messed and up can get back to business!
I spent a few months experimenting with different approaches for writing simple, elegant and maintainable media queries with Sass. Each solution had something that I really liked, but I couldn't find one that covered everything I needed to do, so I ventured into creating my...
Firefox OS is all over the tech news and for good reason: Mozilla's finally given web developers the platform that they need to create apps the way they've been creating them for years -- with CSS, HTML, and JavaScript. Firefox OS has been rapidly improving...
A goal of my latest blog redesign was to practice what I preached a bit more; add a bit more subtle flair. One of the ways I accomplished that was by using CSS3 animations to change the display of my profile icons (RSS, GitHub, etc.) I...
I often incorporate tools into my customers' websites that allow them to have some control over the content on their website. When doing so, I offer some tips to my clients to help them keep their website in good shape. One of the tips...