How to use git with virtualmin?

I’ve correctly installed git & gitweb on my server, and I can create repositories and watch them under
http://sub.domain.com/git/gitweb.cgi
Here is the current relevant directory tree:

/home/user/domains/sub.domain.com/public_html/git/
drwxr-sr-x user user .
drwxr-x— user user …
-rw-r–r-- user user git-favicon.png
-rw-r–r-- user user git-logo.png
-rwxr-xr-x user user gitweb.cgi
-rw-r–r-- user user gitweb.css
drwxrwx— apache user reponame.git


/home/user/domains/sub.domain.com/public_html/git/reponame.git/
drwxrwx— apache user .
drwxr-sr-x user user …
drwxrwx— apache user branches
-rwxrwx— apache user config
-rwxrwx— user user description
-rwxrwx— apache user HEAD
drwxrwx— apache user hooks
drwxrwx— apache user info
drwxrwx— apache user objects
drwxrwx— apache user refs

But I have 2 questions:

  1. When I’m visiting http://sub.domain.com/git/gitweb.cgi, the owner is listed as ‘Apache’. why? how can I change that?

  2. Usually, to create a new git repository, I’ll do something like:

    $ mkdir proj
    $ cd proj
    $ git init
    Initialized empty Git repository in /home/user/proj/.git/
    // here I’m creating the files or copy them from somewhere else
    $ git add *.php
    $ git add README
    $ git commit -m ‘initial version’

But after creating the repository in virtualmin, I can find a new dir named ‘reponame.git’ but not the ‘.git’ dir.
When I’m trying to run any git command (e.g. git status) I’m receiving “fatal: This operation must be run in a work tree”.
How can I work with that repository?