Written by:
Brian Herbert
Ushahidi is an open source project I work on that uses a Git repository for its code. Before this project, I had never used Git before. All of my previous projects used CVS or SVN so there has been a bit of a learning curve getting into this new system. Since I am far from mastering Git ninja skills, I find myself a little frustrated trying to figure out solutions to simple problems I have. While there are plenty of references out there, I figure I would consolidate solutions to Git issues as they come up on this blog for my own personal reference and hopefully to get some feedback on better ways to perform actions in Git.
Today I’ve run into a problem where I have made a number of changes to a file that I want to abandon and replace with the file currently in the repository. This is actually quite simple but the terminology is different than SVN. In SVN, we would be “reverting” changes we’ve made, but in Git, we are “checking out”. This is all you have to do:
git checkout path/to/file.php
For those of you familiar with SVN and need a primer, Git - SVN Crash Course has been a great reference tool.
Recent Comments