How to setup Git Server locally

Website Visitors:

So far you might have used external Git providers like GitHub, GitLab or Bitbucket, etc… or Git software programs like Gitea or Gogs, etc… as your version control systems. But do you know you can also set up a Git Server locally on your PC?

Started thinking about it already? Let me show you how.


  • Two PCs with Git software installed. This tutorial uses two Windows PCs for the same.

Creating Git Server Locally

Let’s see how to create a Git Server locally.

  1. Create a folder where you want to create the Git Server.
Git Server Folder
2. Move into that folder, right click and select Git Bash Here option. This will open a bash command window in the current folder.
Git Bash Here command
3. Run the command git init anyname.git --bare to initialize Git bare repo without the working directory.
Git Init command
  1. You have to enable sharing and firewall options so that this Git server will be visible on network. On your Git server, Go to control panel → Network And Sharing Center > Change advanced sharing settings. Select Turn on network discovery option and Turn on file and printer sharing option.
File and Printer sharing in control panel
5. On your Git server, Go to control panel → Windows Defender Firewall → Advanced Settings → Inbound Rules. Enable File and Printer Sharing (NB-Name-In) on private,public profile and File and Printer Sharing (SMB-In) on private, public profile as shown below.
File and Printer sharing option in firewall
6. Go to the folder you have created Git Server, right click and select properties. Under sharing tab, click Share and add Everyone. Set the permission level as Read/Write.
Sharing Permissions
7. Once the permissions are set, you will find a share path.
Share Path

Connecting to Local Git Server

  1. Go to second Windows PC and open Git terminal and type git clone //GitServerName/PathToGitServerFolder.git command.
Git Clone
2. You can create new files and folders as if you do on a normal Git account.
Git Status and adding files to Local Git repo

That’s it. You have successfully created your own Git Server and published on the network.

Want to learn more on Citrix Automations and solutions???

Subscribe to get our latest content by email.

If you like our content, please support us by sponsoring on GitHub below: