The Synology NAS is a great and extremely flexible piece of kit, with a great UI (thanks to Sencha), tons of awesome packages and some excellent extensibility points. One of those packages is a git server – this no frills article is about the steps you need to take when getting started with git on a synology NAS device.
I completed these steps on my DS411slim with DSM 4, but I have tested this on DSM 5.0 and it works fine. I was also using a windows pc so some steps are only relevant for that.
Steps to get started with Git on a Synology NAS
Enable Git Server Package & SSH
- First things first you need to log onto your synology nas an install the Git Server Package
- Next you need to open the Git Server package from the main menu and enable your user
- Go to Control Panel > Terminal & SNMP
- Enable SSH service and apply changes
Get an SSH Client (Windows Only)
You need to make sure you have an SSH client if you’re on windows. A great client I use is PuTTY, which you can find here. Download and install the windows msi package.
SSH Onto the Synology NAS
Open PuTTY and connect to your Synology NAS from your computer – this is straight forward from PuTTY, and probably the same from other SSH clients.
Create Your Respitory on the NAS
Within your SSH client you need to create a directory for your Git repository. I like to have a folder called Git on the rot of my volume, and have all my repositories within that:1234mkdir /volume1/Gitmkdir /volume1/Git/MyNewProject
Now you need to initialise the repository:1234cd /volume1/Git/MyNewProjectgit init –bare –shared
You also need to make sure the repository is writeable by the account you enabled earlier:1234cd /volume1/Gitchown -R username folder #recursive
Clone the Repository Locally
Finally we can clone the repository on our local machines for working:
git clone ssh://[Git user]@[Your Synology server's IP address or hostname]/[Git repository path]