Skip to content

Git Operations

Create New Repo

  1. Initialize remote

    Repos reside on the Synology drive in a "Shared Folder" at /volume1/git.

    ssh synology git init --bare /volume1/git/<repo-name>
    
  2. Make new repo

    git clone ssh://synology/volume1/git/<repo-name> --origin synology
    
  3. Rename main branch

    git branch -m main
    

Remotes

Formats

git remote add synology ssh://john@john-nas/volume1/git/smarthome_docs.git
With SSH config
git remote add synology ssh://synology/volume1/git/smarthome_docs.git
git remote add gitea ssh://[email protected]:222/john/smarthome_docs.git
With SSH config
git remote add gitea ssh://gitea/john/smarthome_docs.git

Change remote URL

git remote set-url <remote> <new_url>

Submodules

Move submodule within repo

git mv old/submod new/submod

https://stackoverflow.com/a/6310246