简体   繁体   中英

Synology + Git: empty repo cloned via WebDav

I set up a " git --bare --shared " repo on my Synology NAS with SSH connection from local network via VPN (for security). I usually work via SSH and all it's fine.

Now i would to switch to HTTPS to avoid VPN connection but i receive the warning "You appear to have cloned an empty repository" via WebDav although the repo is not empty.

On my Syno and router i set up:

  • git bare shared folder on /volume1/git
  • valid HTTPS certificate
  • port forwarding 443 (HTTPS) and 5006 (Webdav)

If i do a test in a browser with URL https://myddnsurl:5006/git/test.txt i could read the content of file.

But if i run " git clone https://myddnsurl:5006/git/myprojectfolder.git " and enter valid username & password i receive the warning

You appear to have cloned an empty repository

Via browser i got:

You don't have permission to access /git/myprojectfolder.git on this server

Why? Is it a permissions problem? Thanks for help!

Solved! I need 2 things:

  1. On REMOTE: use a post-update hooks

cd git/myprojectfolder/hooks
cp -p hooks/post-update.sample
./post-update

  1. On LOCAL: add username to https URL otherwise i got "error 22"

git clone https://username@myddnsurl:5006/git/myprojectfolder.git

Now i can clone, push e pull via HTTPS! I hope this help will be useful for somebody else. Bye.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM