问题
I have the following estructure which is populated via grok mirror:
/var/opt/git/git-data/repositories
/organization1
/teamA
/repo1
/repo2
/teamB
/repo3
/repo4
/organizationN
/teamN
/repoN
git instaweb works fine for a individual repo but if I want to automatically git instaweb shows all repos under "repositories" dir it doesnt' work:
fatal: Not a git repository (or any parent up to mount point /var/opt/git/git-data)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
Which is true because there is no repo in the parent directory, but if I execute git instaweb
from /var/opt/git/git-data/repositories/organization/teamA/
I get the same error and inside that directory is where the bare repos resides (a repoN.git directory for each repo)
I have set GIT_DISCOVERY_ACROSS_FILESYSTEM
env var without results.
Also I have set /etc/gitweb.conf
the following entry: our $projectroot = "/var/opt/git/git-data/repositories";
As I have read in doc of the project, git instaweb can serve for multiple repos, not only one and it looks for repos under certain directory.
What am I doing wrong?
回答1:
I do this by creating an empty repository and linking to the repositories I want to browse. This workaround is necessary because of the complicated way instaweb runs gitweb and sets the project root.
git init instaweb
cd instaweb
ln -s /var/opt/git/git-data/repositories/org1/teama/repo1 repo1-a-1
ln -s /var/opt/git/git-data/repositories/org2/teamb/repo2 repo2-b-2
git instaweb --httpd webrick
The server is up and running now and the homepage will list a .git project (which is the empty repository you just initialised) along with the two actual projects you linked to.
来源:https://stackoverflow.com/questions/38305637/git-instaweb-with-multiple-repositories-not-working