A couple week’s ago, an awesome colleage of mine asked for my help after a bunch of her git commits seemingly vanished from her computer. What she described was that she just hit the ‘Update Project’ command in Intellij and then they were gone.
I immediately started digging around in the ref-log, and sure enough all of her commits were there. Before I really thought about it I was cherry-picking the commits back to master. In hindsight, the first thing I should have tried was git rebase --abort as its a known fact that 99.3% of Intellij/Git problems occur during a rebase operation.
After we recovered the most critical pieces of work, we did a little investigation into what happens, and it turns out that she had been dutifully committing her code locally but never pushing it upstream to our repository on Github. Presumably while updating the project in Intellij, there was some conflict during an automatic rebase and her working tree was trashed.
As a takeaway of that experience I decided to share my thoughts on how to operate effectively using Intellij and Git using the small, shared-repository model that we use at Intent Media.
Here’s the presentation I put together.
Posted on 15 August 2011.