DAtum

Entrepreneurship, Software and the business of technology

Using Git on Windows without any of the Cygwin/msysgit nonsense

Git was made by Linus – of course there would’nt be a nice library which can be ported to other platforms. So the usual way of using Git on windows would be to use Cygwin/msysgit.

Well there are people who want to use Git, but dont want to use the *nix way of doing things.

Jgit to the rescue – Jgit is a library which implements most of Git’s functionality (which effectively is modeled like filesystem). It is also used as a base for the Eclipse and Netbeans Git plugin.

But there is another co-hosted project org.eclipse.jgit.pgm which implements a command-line interface over Jgit. The way to use it is interesting.

Download jgit.sh. yes the script… it has an embedded org.eclipse.jgit.pgm JAR library.

java -cp jgit.sh   org.eclipse.jgit.pgm.Main <command>

Yes – that’s not a typo. Use the script as the classpath. It works. It doesnt work exactly the same as the vanilla git – but damn close enough.

Java is smarter than I thought.

3 Responses to Using Git on Windows without any of the Cygwin/msysgit nonsense

  1. Pingback: Jenkins and Git « Third Shelf

  2. Afriza N. Arief June 11, 2011 at 2:46 pm

    Or you can use:

    java -jar org.eclipse.jgit.pgm-0.12.1.sh

  3. Afriza N. Arief June 11, 2011 at 2:49 pm

    Oops, the <command> is removed by wordpress.

    java -jar org.eclipse.jgit.pgm-0.12.1.sh <command>

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 )

Connecting to %s

Follow

Get every new post delivered to your Inbox.