Can I use ownCloud to host my own Git repos?

Hi community,

does anybody know if oC can be used to host one's own private Git repositories?

After uploading the Git repo using a WebDAV client, I configured the git client to push to it using WebDAV, but it fails with the error no DAV locking support:

$ git remote -v
origin  https://tobia@MYSERVER/remote.php/webdav/MYREPO.git (fetch)
origin  https://tobia@MYSERVER/remote.php/webdav/MYREPO.git (push)

$ git push
error: no DAV locking support on https://tobia@MYSERVER/remote.php/webdav/MYREPO.git/
fatal: git-http-push failed
error: failed to push some refs to 'https://tobia@MYSERVER/remote.php/webdav/MYREPO.git'

Is there a workaround? Can I enable the locking support somewhere in the server, or disable it in the git client?

Should I give up and just use an SSH account instead of ownCloud?

Here are the relevant access.log lines (there are no error.log entries):

MYADDRESS - - [21/Nov/2016:12:45:57 +0100] "GET /remote.php/webdav/MYREPO.git/info/refs HTTP/1.1" 401 4480 "-" "git/2.7.4"
MYADDRESS - tobia [21/Nov/2016:12:45:57 +0100] "GET /remote.php/webdav/MYREPO.git/info/refs HTTP/1.1" 401 1312 "-" "git/2.7.4"
MYADDRESS - tobia [21/Nov/2016:12:45:57 +0100] "GET /remote.php/webdav/MYREPO.git/info/refs HTTP/1.1" 200 1415 "-" "git/2.7.4"
MYADDRESS - tobia [21/Nov/2016:12:45:58 +0100] "GET /remote.php/webdav/MYREPO.git/HEAD HTTP/1.1" 200 1333 "-" "git/2.7.4"
MYADDRESS - - [21/Nov/2016:12:45:58 +0100] "PROPFIND /remote.php/webdav/MYREPO.git/ HTTP/1.1" 401 4497 "-" "git/2.7.4"
MYADDRESS - tobia [21/Nov/2016:12:45:59 +0100] "PROPFIND /remote.php/webdav/MYREPO.git/ HTTP/1.1" 207 1707 "-" "git/2.7.4"

(I don't know what's up with the 401 entries. Maybe the git client tries authenticating in a number of ways before succeeding?)

Server configuration
Operating system: Ubuntu Trusty
Web server: Apache 2.4.7-1ubuntu4.13
Database: MySQL 5.5.53-0ubuntu0.14.04.1
PHP version: 5.5.9+dfsg-1ubuntu4.20
ownCloud version: 9.1.2 (stable)
Updated from an older ownCloud or fresh install: fresh
Special configuration: none

Hi,

i think you shouldn't waste your time trying to get git running on oC. This is the completely wrong use-case for ownCloud. oC is about file sharing and syncing, not about being a webserver to serve stuff like .git repositories. Especially as oC is also known to be slow with small files.

1 Like

While we are working on the small files (with a feature called bundling) I fully agree on the use case.
The WebDAV locking is indeed not implemented in ownCloud at this time.

All right. In that case, I'll just use the SSH account I have on my server and keep the Git repos in my home, outside of oC.