Setup Git Server in Synology NAS

Configuring the version management service in the NAS at home can greatly facilitate the daily work of the SOHO family. This article demonstrates how to configure the git server service in a Synology nas

Install Git Server suite

In the Synology Nas suite, the Git Server is already included. we need only install it.

In Synology Nas suite window, search ‘Git Server’ in all suite tab, then install it.

After installation, you need to choose which users can use the git server.

Create Git repositiry

To set up a Git repository on a NAS, we first turn on the SSH function of the NAS. Then use ssh to log in to nas to set it up.

Let’s take the example of setting up a repository for Java SE projects to demonstrate the entire process and related commands: (Suppose the repository to be built is named javase)

  1. Log in to the NAS with ssh

  2. Switch to the /volume1/GitRepos directory and create a new one if it does not exist

cd /volume1/GitRepos
  1. Create a folder for repository
mkdir javase.git
  1. Enter the folder
cd javase.git
  1. Initial reposiory

Execute the following commmand:

git --bare init
git update-server-info
  1. Change the permission of the folder.
cd ..
chown -R xxx:xxx javase.git

Steps 6 is mainly to assign permissions to the directory, which in my NAS can be omitted because the logged-in user is directly authorized

Use the git client to access the repository

On the client side, you can use the following url to clone the repository:

git clone ssh://

本文标题:Setup Git Server in Synology NAS

文章作者:Morning Star

发布时间:2022年01月17日 - 09:01

最后更新:2022年01月17日 - 09:01


许可协议: 署名-非商业性使用-禁止演绎 4.0 国际 转载请保留原文链接及作者。