Add Git Repository to Synology Server

To create a Git repository:

  1. SSH into your server as root or admin.
    $ ssh admin@diskstation
  2. Change to the directory you have for your Git Repositories.
    admin@diskstation: cd /volume1/git/repo
  3. Create the folder to contain the repository.
    admin@diskstation: mkdir project
  4. Create a bare git repository. It will be bare since there will be no project files checked out here.
    cd project
    git --bare init

Once the repository is created, a Git client user can then use the repository with the address: ssh://username@diskstation/volume1/git/repo/project.


Leave a Reply

Your email address will not be published. Required fields are marked *