Showing posts with label dcvs. Show all posts
Showing posts with label dcvs. Show all posts

Friday, April 18, 2008

Quickie git-daemon

Git-daemon is a mini-server for git repositories. It is small and cute, and suitable for sharing repositories within a local network or small groups.

Steps to getting it running
  1. Clone your existing git repository with "git clone --bare current_repo new_repo"
  2. Create an empty file called "git-daemon-export-ok" within the new repository
  3. "git-daemon --base-path=parent_of_new_repo"
In step 3, base-path should not end in a slash.

Now, you will be running git-daemon on port 9418 on your computer. It's address is git://server-location/new_repo

To get commit access, this method requires ssh and is very easy.

Monday, April 14, 2008

Converting Mercurial to git

I tend to forget how to do these one-time operations, so I'm listing it here for reference (taken from the readme).
  1. Grab hg-fast-export from here
  2. Make an empty directory for the new git repository
  3. From this empty directory, run the following commands:
  4. git init
  5. hg-fast-export.sh -r "location of mercurial repo"
  6. git reset --hard

If you're lazy like me, you can copy the files in hg-fast-export over to the new directory, run hg-fast-export.sh and then delete them afterwards (before step 6).

So far, it seems to be a very clean transition, all commits are in place. Of course, the repository is very small with no branches so no issue was expected.

Oh yeah, Mercurial and Git are distributed version control systems which greatly lessen the dependency on the old subversion client-server model. As to which one is better, I'm totally not qualified to make any judgement, but git does take 3 letters to type, while hg takes just 2. :)