Dark Light

Git is an open-source distributed version control system that allows you to manage software source code, documents, or any form of a file on a computer with speed and efficiency. With Git, you may easily collaborate with several groups of individuals at the same time.


Step 1: Setup Git Server

Sign in to DSM with a user account that has administrative capabilities, then go to Package Center and install Git Server.

Step 2: Setup a Git Repository

  1. Enable the SSH service by going to Control Panel > Terminal & SNMP > Terminal.
  2. Create a shared folder for Git repositories by going to Control Panel > Shared Folder.
  3. To connect to Synology NAS through SSH, run the following command on your computer:
ssh [admin username]@[IP address or hostname] -p [the port number of SSH]
  1. To change the current directory to the shared folder you established in step 3, use the following command:
cd /[volume name]/[shared folder name]/
  1. To create a folder on your computer for the Git repository, use the following command:
mkdir [repo folder name]
  1. To change the current location to the new folder, use the following command:
cd [repo folder name]
  1. To establish a Git bare repository inside the folder you created in step 6, use the following command:
git init --bare

IMPORTANT: Do not perform the above commands with root permission.

Step 3: Setup the Git Client

Install Git client on your Mac or PC from the following source:

https://git-scm.com/downloads/guis

Step 4: Access the Git Repository

  1. Please ensure the following conditions are met on Synology NAS in order to properly access the repository:
    • The SSH service is enabled.
    • The repository may be accessed with the user account you’re using.
    • The user account you’re using has Read/Write access to the shared folder where the repository is stored.
  2. To access the Git repository, use the following command on the Git client:
ssh://[admin username]@[IP address or hostname]:/[volume name]/[shared folder name]/[repo folder name]

Related Posts