Configure GIT Server On Windows Server 2008

We are using SVN since long time as version control system for our local development and quite happy with it as well until I come across GIT. GIT get lots of popularity in last couple of years but never get chance to look into this Although we were hosted some of our open source project/code on and pretty easy to use and impressed with forking ability. After getting use to with GIT it was time to implementation, we do not want to move our code to or other same kind of website rather create Git server on our local environment only and on windows server.

My idea was we will install Git on our windows 2008 server and programmer will clone source code using Eclipse egit plugin (git client) to their system where they can work on repo, commit and finally push back changes to server. First step was installing Git on server and msygit make this really easy. Just download installable executable and run it and follow steps on wizard, pretty easy right? msygit support git protocol so developer can clone repository with git URL like git://[server]/[repository], you may need to git daemon command to enable git protocol. See below command to enable git protocol on server.

I was happy that I was able to clone repository on my development computer and commit successfully but this wasn’t end, when started push changes on server it doesn’t work, simply keep processing and no response. After bit of googling I found there were many other who has same kind of issue but didn’t find any proper solution. During researching I came across Stackoverflow question which is high rated and numerous answer and thought my search over here. Since there are so many answers and some of them are really older so I choose easy to configure and latest answer and that was using GitStack

Installed GitStack which has inbuild Apache and build on DJango (Python web framework). In installation Apache by default configure on port 80 so if you already using IIS ported on 80 then service may not start. You may required to change http port to something else to make it work. GitStack actually enable HTTP protocol for you also give you web interface to manage repositories and user. Well after installation seems working good, I was able to create repository, manage use but when try to clone it give me fatal error. There is an answer about same issue on GitStack site but that doesn’t work for me, check all path and settings and seems everything correct so again drop idea about GitStack.

ADOPTED Solution.

Before I start pulling my hair, I fount GitBlit and my search is over. GitBlit is pure java based, open source project for managing git repository. If you are familiar with tomcat installation then I recommend to download war version of GitBlit. Download executable fo tomcat latest version and install it. In my case I had use tomcat 7.x executable, during installation it asked for http port so I can specify whatever I like and avoid conflicting with IIS http port. In my case I have used port 8080. After installation open URL http://localhost:8080 on browser and it will open up tomcat welcome page, you may find button to "Manager App" where you can add/remove tomcat application. It will ask for username and password which you have set at the time on installation. In manager app interface deploy downloaded war file of GitBlit and done. Try URL http://localhost:8080/gitblit-0.8.2 on your browser (it may be different in your case) and default username and password ‘admin’. Cool, I can manage users, manage repositories and now time to clone and push changes. And finally everything seems working for me. I can now clone repository, commit changes to working directory and push it back to server repository and nice web interface to view history of changes. 

While viewing history in web interface for some of files I can’t view changes rather Chrome display just blank page and IE gives me 400 error. It come out that whenever trying to view history/diff of grouped file/directory and it cause 400 error. This is because tomcat stoping it, just follow steps mention in FAQ heading "Running Gitblit on Tomcat"  and restart your tomcat server and it should work fine.

Hope this help and feel free in case of help.