SVN or git?

@film_firl poked @WordPressVIP to ask @wordpressvip @mjangda @viper007bond MOOOOVE TO GIT!!! she half-kids. No really, please? — Christina Warren (@film_girl) January 18, 2013 @nacin piled on with @viper007bond @film_girl @mjangda VIP aside, it’s fairly crazy that hasn’t migrated. SVN != tenable dev environment. — Andrew Nacin (@nacin) January 18, 2013 @Viper007Bond tried to defend the team, and […] » about 300 words

There’s no ‘git cp filename’?

Here’s a sequence of unbelievable things:

  1. Yes, despite a lifetime in Subversion, I’m really this new to git!
  2. I’m going to link to Livejournal in this post!
  3. Git really doesn’t have an equivalent to svn cp filename!

I spent a surprisingly long time reviewing the man pages and surfing the internet to confirm this, but git really assumes you’ll never want to copy a file with history. Here’s that Livejournal link I promised, where markpasc has similar complaints — from 2008, no less.

I was looking for a way to copy a file with history because I needed to break a single file into multiple pieces. In my Subversion days I would have done a svn cp old-file.php new-file.php. From there I could prune old-file.php and new-file.php down to what I needed while preserving the full history for all the code that remained.

Or perhaps I’m missing something?

Moving a Subversion Repository

I foolishly just moved a Subversion repository by importing the contents of a current checkout into a new repository. Wrong. A friend pointed out these instructions that make it easy and preserve the revision history.

Here’s the trick:

svnadmin dump /path/to/repository > repository-name.dmp


svnadmin load repository-name < repository-name.dmp

[tags]svn, subversion, move, repository[/tags]