Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

git

nas

synology

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 :

  • How do we do to set up this official package ?
  • How can I create a repo with one of my projects on my NAS ?
  • Finally, how will I do to "interact" with my project ?
like image 603
FR073N Avatar asked Nov 19 '13 14:11

FR073N


People also ask

How do you add SynoCommunity?

In the Package Sources tab, click Add, type SynoCommunity as Name and https://packages.synocommunity.com/ as Location and then press OK to validate.


1 Answers

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.

like image 51
zako42 Avatar answered Sep 18 '22 18:09

zako42