gitnassynology

Set up GIT on a NAS with Synology's official package


I bought 2-3 months ago a Synology 213air NAS for programing purpose.

Then before trying to set up git manually on my NAS, I heard that DSM4.3 will propose Synology's official package. So I decided to wait.

The DSM4.3 with Git package is now out : http://www.synology.fr/dsm/dsm_app.php#Git, but there is no tutorial for beginners like me to set up Git.

So :


Solution

  • I found some helpful info on the Synology forum here:

    http://forum.synology.com/enu/viewtopic.php?f=190&t=73064

    First you should install the package via your Diskstation package manager and enable it. This will create a Git folder on the NAS. I created a user called "gituser" and granted it read/write permissions to the Git folder. You don't need to do that, but I like to create users specifically for different functions on the NAS. From there, you will need to set up your repository manually, because there is no graphical interface provided by Synology yet.

    To create a repository, you will need to enable SSH for your NAS. Go to the control panel --> terminal --> enable SSH service and make sure it's enabled. Now SSH to it using the admin account / password. cd to the volume you created for the NAS (probably volume1). There should be the git folder there. cd to it and create your repository there.

    for example:

    ssh admin@nas
    cd volume1/git
    git init --bare --shared reponame.git
    (add files, etc)
    

    Then using an account which has access to the git folder, you should be able to pull and push, etc.