Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Run git server on local network [duplicate]

Tags:

I have a small company, for managing project I want run a git server in my company (local). How can I install git server on our local windows server?

I want my programmers can use git commands to connecting to this server.

like image 500
MajAfy Avatar asked Jan 28 '14 15:01

MajAfy


People also ask

Can git be run locally?

If you want to work with Git locally, but do not want to use the command line, you can instead download and install the GitHub Desktop client.


1 Answers

I assume you already have your local Git set up. For that, there are plenty of resources on the Internet, including this blogpost about Windows Git tooling.

The entire tricks works like this – expose folder containing your shared Git repository as Windows network share.

Step one – bare git repository

There are two twists to the entire solution – one of them is – your shared repository needs to be initialized with --bare flag.

enter image description here

Step two – Windows share

Second step is to expose the folder with our newly created repository on the Windows share. You also use your standard Windows mechanisms to control and limit access to the folder (make sure you give the developers write access!).

Step three – Map the share as network drive

This step is perhaps not exactly necessary but I couldn’t get it to work otherwise, so here comes the second twist. In order for your developers to be able to access the shared folder via Git they need to map it as network drive.

enter image description here

Step four – Add remote repository in Git and code away

Last step is the standard Git procedure – every developer on your team needs to add the repository sitting under their newly created network drive as remote. Notice the use of “file:///” prefix in front of the mapped drive name.

enter image description here

like image 143
Pedro Lobito Avatar answered Oct 05 '22 00:10

Pedro Lobito