Using git diff for doc, xls, pdf, ppt, odt:
https://gist.github.com/mbrehin/634f46aeacb0a9a6da5e (pdf)
for docx use pandoc as following (https://blog.martinfenner.org/posts/using-microsoft-word-with-git):
[diff "docx"]
textconv=pandoc --to=markdown
prompt = false
Git personal server
(Gitolite, Cgit, fcgiwrap, and Nginx)
https://bryanbrattlof.com/cgit-nginx-gitolite-a-personal-git-server/ (pdf)
and more of freshly-baked gitlab alternatives: https://www.cyberciti.biz/open-source/github-alternatives-open-source-seflt-hosted/