Skip to content

Instantly share code, notes, and snippets.

@todgru
Last active September 29, 2020 21:15
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save todgru/cacfef72ef927d1b98fc427817589887 to your computer and use it in GitHub Desktop.
Save todgru/cacfef72ef927d1b98fc427817589887 to your computer and use it in GitHub Desktop.
run simple git server on synology nas
#!/bin/bash
#
# ./newrepo.sh <repo-name>
#
cd /volume1/homes/<username>/git-repos
git --bare init "$1".git
cd "$1".git
git update-server-info

after setting up ssh/passwordless login, install git server through Synology package manager.

SSH into Synology server. Run:

$ pwd
/volume1/homes/<username>/
mkdir git-repos
cd git-repos
git --bare init <repo-name>.git
cd <repo-name>.git
git update-server-info

on client, locally clone the new empty repo:

git clone ssh://<username>@<synology-ip-address>/var/services/homes/<username>/git-repos/<repo-name>.git
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment