I am mikek's Blog

The personal blog of Mike Karthauser, who you may know from Brightstorm Limited or the internet.

Cleaning up repositories

I’ve given a lot of files that once were in a mercurial repository but now need adding into another one.

Like with svn, mercurial file trees have hidden folders containing details about the commit history. If these get added into a new repo, things stop working properly.

The trick is to recursively delete these folders then all is good.


// find and remove .hg files in the filesystem
find . -name ".hg" -exec rm -rf {} \;


// works with svn files as well
find . -name ".svn" -exec rm -rf {} \;

Advertisements

Filed under: code snippets, development, , ,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

mikek on twitter

%d bloggers like this: