Git

How to Set Up Git Server on Local Network (Windows Tutorial)

Git is a well-known distributed version control system that permits developers to collaborate on a project and keep tracking the changes made to the project’s codebase over time. If a user wants to set up a Git server on a local network, it can be useful for a team or a group of developers who want to collaborate on a project.

This tutorial will demonstrate the method for setting up a Git server on the local network.

How to Set Up Git Server on Local Network (Windows Tutorial)

To set up a Git server on the local network, check out the below-stated instruction:

  • Make a folder where you want to set up the server.
  • Open Git bash in the specified folder.
  • Initiate a Git empty repository.
  • Clone the created repository.
  • Change the advanced sharing setting of your local system.
  • Move back to the created folder and launch the properties.
  • Lastly, share this repository with your preferred users/client.

Step 1: Make a Folder
First, create a new folder where you need to set up the Git server:

Note: The name of the folder should not contain any blank spaces.

Step 2: Launch Git Bash
Next, right-click in the created folder. A small menu will appear on the screen. Click on the “Git Bash Here” option to launch the terminal on the screen:

Step 3: Generate an Empty Repository
Utilize the “git init” command to initialize a repository and provide the name of the repository:

git init source.git --bare

The below output indicates that the repository has been initialized successfully in the specified folder:

Step 4: Clone the Repository
Now, clone the created repository by executing the “git clone” command along with the path of the particular repository:

git clone C:/Users/Public/Git_Server/source.git

It can be observed that the repository has been cloned successfully:

Step 5: Modify Setting
To change the setting, first, navigate toward “Control Panel > Network And Sharing Center > Change advanced sharing settings”. Modify the required setting and save the changes by hitting on the “Save Changes” button:

Step 6: Share With Other Clients
Now, you can share this repository with others for use. For that purpose, open the created folder and move to the properties by right-clicking. Then, click on the “Share” button and choose your preferred User/Client:

That’s all about setting up a Git server on the local network.

Conclusion

To set up a Git server on the local network, first, make a folder where you want to set up the server and open Git bash in the specified folder. Then, initialize a Git empty repository and clone the created repository. Change the advanced sharing setting of your local system, move back to the created folder, and launch the properties. Lastly, share this repository with your preferred users/client. This post stated the method for setting up a Git server on the local network.

About the author

Hafsa Javed