How to nuke a git commit on the remote repo
Here is the situation I ran into this morning. I was happily writing code, periodically pulling changes from GitHub, like a good developer that I am. When I was finally ready to push, I received a merge from GitHub that deleted most of my Django project files. Turns out that one of the other developer on the team accidentally deleted those files and committed it locally. He didn’t push all the commits up to GitHub until just before I tried to push mine (hence I didn’t get any merges from him all morning).
So now I’m in this state where my local repo has a number of commits that I need to push up. But I can’t because I don’t want to merge in all the accidental deletes. I need to remove/fix the deletion first before I can push. How do I do that? After a few minutes on Google, I got the general approach of using git rebase but nothing that points me to actual steps that I think will fix my problem. Then I turned to Twitter, posted a question, and waited while I did some more googling. Low and behold, I received tips from @XTZGZoReX on a possible approach and after I tried it out, it works perfectly!
Here is how:
- Leave the existing local repo alone. You may want to reset it back to the pre-merge state by doing
git reset --hard - Make a fresh clone of the repo from GitHub. Let’s call it repo2.
- Perform an interactive rebase on repo2 and set the starting point to one commit before the one you want to nuke:
git rebase -i - The interactive rebase will open up a text editor (vi if you haven’t changed the default configuration) with a list of all the commits starting from the commit you want to nuke to the latest.
- Remove the line with the commit you want to nuke (‘dd’ keys in vi) and save the file (‘:wq’ in vi)
- Git will now try to apply all the subsequent commits and roll forward to the latest state. In my case, I needed to manually add and remove some files on some of the commits. After each git add/remove, you need to tell git to continue the rebase:
git rebase --continue - When all the commits are roll-forwarded by git, push it up to GitHub by doing a force push:
git push -f - Now, switch back to your original repo and pull the latest from GitHub. Good chance that you will get merge conflicts. Resolve, commit, and push. And you are done!
Sparrow – Improvement from Mail.app?
I finally have enough of Mail.app this week. Mainly because I’ve been spending more time using it constantly last couple of weeks and notice many small things that bug me. So I start looking for alternatives and ran into Sparrow in the Mac AppStore so I decided to give it try.
Disclaimer
I’m not a huge email person. I’m more a face-to-face or Twitter person. I don’t get many emails a day, nor I create many new emails. Partly because I use email for communication only and not for other purposes. I don’t use email as my repository of information, I use Evernote for that. And I don’t use email as a to-do list, I have Remember The Milk. I also apply “Inbox-zero” approach to my emails so they are either actioned pretty much straightaway or they are deleted/archived.
I’ve used Sparrow for only 2 days so my opinion may (and probably will) change in the future.
First full day with Windows Phone 7 and only that
Despite Google Voice continual refusal to work with my AT&T pre-paid number, I decided that today will be a good day to try using my Windows Phone 7 exclusively for the day. My wife, Leah, is still in the UK and my parents who are visiting me here in NY will be with me all day. So no one in particular should be calling me, and I set the call forwarding on my iPhone to the LG.
Continue reading “First full day with Windows Phone 7 and only that”
Finding Windows Phone 7 apps
On my iPhone/iPad, I rely on a collection of apps to make my life easier, more fun, and happier. In order to be able to fully immerse myself in the Windows Phone 7 world, I am hoping I can find the equivalent on WP7 Marketplace. Here is my progress so far:
iPhone apps |
Windows Phone 7 apps |
| Tweetbot | Birdsong/Twitter/Seesmic |
| Reeder | Feed Reader/GReadr |
| Foursquare | 4th & Mayor |
| Remember The Milk | WinMilk |
| Evernote | fasternote |
| Instapaper | Stacks for Instapaper |
| Weather Channel | Weather Channel |
| BBC News | BBC News Mobile |
| CNN | Web page pinned to Start page |
| Flickr | Flickr |
| Wikipanion | Wikipedia |
| WordPress | WordPress |
| OpenTable | OpenTable |
| Tip Calculator | Tip Calculator |
| Urbanspoon | Yelp |
| IMDb | IMDb |
| Netflix | Netflix |
| Amazon.com | Amazon.com |
| Amazon Kindle | Amazon Kindle |
| Google Voice | GoVoice |
| 1Password | 1Password |
| Pandora | N/A |
| Verizon FiOS DVR Manager | N/A |
| Skype | N/A |
| Meetup | N/A |
| N/A | |
| Words with Friends | N/A |
This is by no mean the complete list of apps I have on my iPhone, just the ones that I use almost every day and thus need to find equivalent on the WP7 side. I’ll update the list as I explore the Windows Phone Marketplace more. My hope is that this post will help other iPhone owners who want to try out WP7.
