Sunday, January 4, 2015

Git: Setup and run Git Server on Windows 8.1 and with VS2010

This post introduce how to setup Bonobo git server on Windows 8.1 and how to use VS2010 to perform source control with Git.

Section 0: Install IIS on Windows 8.1

Enter "Turn Windows features on or off" in the "Search" box to launch the dialog.

In the "Windows Features" dialog, select the features as shown in the following figure.



Click "OK" and restart the computer.

Before we proceed further, we also need to allow the IIS through the windows firewall so that another computer can access the git server for source control. To this end, enter "allow an app through windows firewall", and in the dialog opened, scroll to the bottom to locate "World Wide Web Services (HTTP)" and check the option boxes next to it, and click OK.

Section 1: Install Bonobo Git Server in IIS


Download the Bonobo git server from the following link:

https://github.com/jakubgarfield/Bonobo-Git-Server

Unzip and copy the unzipped content (i.e. the "Bonobo.Git.Server" folder) under "C://inetpub/wwwroot" folder.

Enter "Internet Information Services (IIS) Manager" in the "Search" box to launch the IIS Manager.

In the IIS Manager, select "Sites->Default Web Site->Bonobo.Git.Server" tree node in the left panel, right-click the "Bonobo.Git.Server" node and select "Convert to Application", and click OK in the dialog opened.

In the IIS Manager, select the "Bonobo.Git.Server" node again and right-click to select "Edit Permissions ...". In the properties dialog popup, select the "Security" tab, select "IIS_IUSRS" and click "Edit" button. Check "Ready & Execute" option.

In the IIS Manager, select Bonobo.Git.Server->App_Data node and right-click to select "Edit Permissions ...". In the properties dialog popup, select the "Security" tab, select "IIS_IUSRS", check the "Write" and "Read" options.

Close the IIS Manager, and launch a web browser, enter http://localhost/Bonobo.Git.Server

In the http://localhost/Bonobo.Git.Server, login using default username and password (both default to "admin").

Create a repository (said, "HelloWorld"), and copy its url (which should be something like "http://localhost/Bonobo.Git.Server/HelloWorld.git")

Section 2: Install VS2010 extension for Git 

Download and install Git Extension from the following link:

https://code.google.com/p/gitextensions/

Download and install Git Source Control Provider from the following link:

http://gitscc.codeplex.com/releases/view/46589

Launch Visual Studio 2010, select "Tools->Options" from its menu.

Select "Source Control" in the left panel, and set the "Current Source Control plugin" combobox selection to "Git Source Control Provider"

Section 3: Commit and Push using Git

Now open a C# solution "HelloWorld.sln" in Visual Studio 2010, and right-click the solution to select "Create Git Repository".

Right-click the solution in VS2010 again and select "git(master)->push", in the settings page appear, click OK. The next dialog appeared is the push dialog, select the "url" option and enter "http://localhost/Bonobo.Git.Server/HelloWorld.git", then click "OK".

Enter the username and password (of http://localhost/Bonobo.Git.Server/) in the prompts.

Right-click the solution in VS2010 again and select "git(master)->commit", enter some comments for the commit, and then click "Commit and Push". (if asked to stage and commit all files, click Yes / OK). Alternatively you can go to "Pending changes" -> enter comment -> commit, and then do the push.

Section 4: Useful Links:

http://bonobogitserver.com/install/
http://blog.discountasp.net/using-git-with-visual-studio-2010-an-introduction-2/

No comments:

Post a Comment