Problems cloning git repository over https

Every once in a while I need to clone a git repository by using https as connection protocol. Unfortunately, there always seems to be trouble with this.

Here are some things to keep in mind when dealing with git over https.

Update your Git Version

First of all, make sure you are running an up-to-date version of git. There used to be problems with https in older git versions. Everything from 1.7.10 onward should be fine. But to be on the save side, I recommend to use 1.8.3 or later.

To find out which version you are running, type:

git --version

SSL Certificate Problems

If you see this:


error: SSL certificate problem, verify that the CA cert is OK. Details:
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed while accessing https://myserver/repositories/myrepo.git/info/refs?service=git-upload-pack
fatal: HTTP request failed

It means the client can’t verify the server’s certificate (e.g. self-signed certificate).
The easiest way to get around this, is to disable the SSL CERT verfiy by setting:

git config --global http.sslVerify false

Of course the cleaner solution would be to give the server a proper ssl certificate. Unfortunately, this is not always in your hands.

Using local GIT to access remote SVN repository

git is nice. Very nice. But as we are still using SVN for many projects, using git is not always possible. Or, is it?!

Luckily, git comes with very nice support for using it in combination with an SVN remote repository. By doing so, you can clone any SVN remote repository into a local git repository, create local branches, local commits, local reverts, etc… and finally push everything back to SVN.

Creating the initial clone
git svn clone -T trunk -t tags -b branches -A authors.txt {your_SVN_repository_url} {your_local_git_repsoitory_name}.GIT

Example: git svn clone -T trunk -t tags -b branches -A authors.txt http://myserver.com/svn/myrepo/ myrepo.GIT

Note: You need to have an authors.txt file in your local directory from where you execute the command. The file should contain all contributers from the SVN repository. On stackoverflow.com you can find a command to create such a file.

Get latest changes from SVN trunk and pull them into master
git checkout master
git svn rebase

Commit local changes back to SVN
Make sure to apply a git svn rebase first! (See above)

git checkout master
git svn dcommit

Building Spring Roo from Source

Spring Roo 1.1.0 M1 has just been released and the development on 1.1.0 M2 is just about to start. If you want to check it out from the development stream and see the latest features, here is the tutorial you need. If you are running a Windows operation system this task is quite a bit more challenging. All you ubuntu (and most of the other *nix systems) users only need to do this:

sudo apt-get install git-core gitk
git clone git://github.com/SpringSource/spring-roo.git
cd roo
mvn clean install
sudo ln -s bootstrap/roo-dev /usr/bin/roo-dev

Thats it, seriously! For all the Windows users, read the following paragraphs to accomplish the same.

Installing Git on Windows

First of all you need to install a version of Git for Windows. I decided to not go with the Cygwin + Git option, but instead install Msysgit. A third alternative for Windows is to use Egit for Eclipse, I may discuss that in a couple of days here as well.

There is a nice blog post by Kyle Cordes on the installation of Msysgit. In my case I downloaded version 1.7.0.2-preview double-clicked it and kept all the default installation options (this changed the font style of my cmd shell, but I could change it back later).

Edit: If you get an error like this one Result of cmd.exe /X /C “git log “–pretty=format:Git-Commit-Hash: %H” -n 1″ execution is: ‘1’. you should add {Msysgit_installation}/cmd to your PATH environment variable.

Getting Roo Sources via Git

In the next step you need to create a local clone of the current Roo sources by using Git. Therefore you should create a new folder in which you want to store the files. Right-click that folder and select Git Bash from the context menu. The git command bash opens.

Enter git clone git://github.com/SpringSource/spring-roo.git and wait till it is finished. This will create a new folder named roo. You should see something similar to the picture below.

Roo setup 3

Building Roo Sources via Maven
Open a windows command shell and switch to the created roo folder. Build the project by typing mvn clean install. (I assume you already have Maven 2 installed, if not do so now). Wait again, this may take a couple of minutes.

Configure Roo-Dev
The last thing you need to do is setting up an environment variable called ROO_DEV_HOME in your system settings, which should point to the bootstrap folder within the roo folder. You also need to add this variable to your path environment variable. See the screenshots below (sorry, that those are in German. I guess you mange to set up environment variables anyhow).

Roo setup 1

Roo setup 2

Using Roo-Dev
You can now use your build development version of Roo. Just open the windows command shell, type mkdir myproject, cd myproject and roo-dev. By now you should see something similar to the below picture. If so, congratulations! You are now running the current development version of Spring Roo.

Roo Setup 4

Updating Roo-Dev
You may want to update your Roo development version from time to time. Therefore open the GIT shell as you done have before. This time type git pull, which will pull all the remote changes into your local clone. Do not forget to run mvn clean install afterwards to build the changed sources.