Switching from SVN to git
I’ve been using SVN for several years now, so I’ve been partial to it, and reluctant to switch to another form of source control. I’m very comfortable with it, and I’ve got dozens of scripts to augment it and help me deal with it’s shortcomings, as well as a few blog posts.
- Easier to create a repository from existing code.
- Git stash is really, really cool.
- I finally understand why I’d want the entire log on my machine.
- The git client supports SVN.
This is the first thing I noticed about git that absolutely crushes subversion. With subversion, you have a repository that you check files out of. With git, you can literally create the repo while you’re in a directory.
git init
The above line creates a new repository for you in your current directory. Everything in there is now under version control. It’s awesome. So simple and elegant.
It’s nice to see that other people encounter the same problems I do when using SVN. I’d be working on something, need to switch to a different branch, but I don’t want to commit my work. It’s not done, and I didn’t create a branch to start. Yes, I should have, but I thought it would be less than an hours work, and SVN’s merging kind of blows. So I didn’t.
Use git stash when you want to record the current state of the working directory and the index, but want to go back to a clean working directory. The command saves your local modifications away and reverts the working directory to match the HEAD commit.
Yes, there are ways around this in SVN, but it’s still a pain to merge in changes when I’m done. Merging in your temporary stash is simple:
git stash apply
On my first day using git, I had already used this feature. Very handy.
I’ve always worked out of an office where my repo was on a gigabit line and was sitting nearby. I also was usually SSH’ed into the machine so I could just do the commands remotely and see the output. However, I’m doing some work over a VPN, and using SVN is incredibly slow and annoying. It’s also over http only, so I’ve lost my sweet file:///. Git absolutely crushes SVN here.
It’s nice that I don’t need to migrate everything over right away. I like making commits that aren’t shared with everyone right away, since I might do a lot of work that I consider valuable, but doesn’t end up compiling or working at all. I realize I could branch here, but I’m not always on top of things. This ties into the stash mentioned above.
Recent Comments
- Anil on MySQL Triggers Tutorial
- Ashish on MySQL Triggers Tutorial
- David on iCal Agenda
- jon on IP address geolocation SQL database
- pim on IP address geolocation SQL database
- jnns on Redis Wildcard Delete
- K.C. Murphy on iCal Agenda
- BA on Experts Exchange should be removed from Google search results
- Andrew on Executing multiple curl requests in parallel with PHP and curl_multi_exec
- Stu on Executing multiple curl requests in parallel with PHP and curl_multi_exec
Recent Posts
- New Project: Jester
- Open New Terminal Tip
- Installing MySQLdb on MacOS Lion
- Headless VM Server Using Ubuntu 11.10
- Get rid of Facebook’s Awful Ticker
- Api Tester now hosted on Github
- Trac .11 jQuery bug
- Multiple Filetypes in Vim
- Git Tip: Setting Up Your Remote Server
- Install issue pymongo on OSX (setuptools out of date)
Categories
- amazon (1)
- answerbag (6)
- apache (9)
- apple (8)
- awk (2)
- bbedit (2)
- c++ (3)
- chrome (2)
- cluster (1)
- cocoa (1)
- collective intelligence (1)
- curl (3)
- db2 (1)
- demand media (1)
- ebay (1)
- eclipse (4)
- erlang (13)
- facebook (1)
- fortran (1)
- gen_server (1)
- git (5)
- google (4)
- haddad (1)
- hdf5 (1)
- html (1)
- innodb (1)
- itunes (1)
- java (2)
- jester (1)
- kvm (1)
- launchbar (1)
- leex (1)
- letsgetnuts.com (1)
- libvirt (1)
- links (6)
- linux (27)
- lucene (1)
- mac (16)
- memcached (1)
- misconception (1)
- mobile (1)
- mono (1)
- mssql (1)
- munin (1)
- mysql (31)
- numpy (1)
- oracle (1)
- php (23)
- puppet (4)
- pyparsing (1)
- pytables (1)
- python (11)
- q&a (1)
- quicksilver (1)
- rant (6)
- readynas (1)
- redis (2)
- regex (1)
- replication (1)
- search (1)
- shitty code (1)
- solr (3)
- spaces (1)
- sshfs (1)
- stored procedure (1)
- svn (5)
- textmate (2)
- tips (22)
- trac (1)
- tutorial (4)
- ubuntu (3)
- Uncategorized (4)
- unix (1)
- vim (3)
- virtual box (6)
- vmware (1)
- weird (3)
- wikipedia (1)
- windows (1)
- xcode (1)







