3

Have just started using git. Building and installing it was easy. Then I went into the directory of one of my web projects and added a git repo to it.

$ cd ~/Sites/webapp
$ git init (and so on)

I also set up gitweb, and when I added ~/Sites/webapp to $projectroot setting in gitweb.cgi, that appeared in my browser when I went to http://localhost/gitweb/gitweb.cgi

My question is thus -- from what I understand, git doesn't have a central repo concept. Every project that I may be working on will have its own git repository. Since my projects are all over my hard disk, their respective repos are also all over the hard disk. How do I add multiple repositories to gitweb? Is there some kind of central registry of all my repos? Should I really rejig how I work, and move all my projects to a central directory? How is this done?

punkish
  • 13,598
  • 26
  • 66
  • 101

2 Answers2

5

Better late then never I guess.

I solved it by creating a project root directory and linking the git repositories.

project_root="/opt/gitweb"

In /opt/gitweb

ln -s ~/Sites/webapp webapp.git
ln -s ~/someotherplace/whereitis/application appliation.git
Peter van der Does
  • 14,018
  • 4
  • 38
  • 42
  • Not sure I follow. I too would like to see many repos under one gitweb service. For example, /srv/audio/.git/config and /srv/bike/.git/config. Instead of running `git instaweb -d apache2 --start` in each of /srv/bike and /srv/audio, what would I do? Create a third folder, and soft link what? Then run what? – Marcos May 13 '14 at 10:42
  • 1
    I used to use gitweb, but I guess you can use instaweb as well: Create a third folder "/3rdfolder" and in the folder you do "ln -s /srv/audio audio.git" and repeat for other repos that you need. Then fire up instaweb in "/3rdfolder". Read more about [installing gitweb](http://git-scm.com/book/en/Git-on-the-Server-GitWeb) – Peter van der Does May 13 '14 at 12:41
0

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 ~/projects/gitproj1 gitproj1
ln -s ~/projects/gitproj2 gitproj2
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.

user3817313
  • 71
  • 1
  • 4