Configuring git server for company

hey everyone,
i’m new here, and since there’s no dedicated forum for other server software then http server, so i’m posting here, hope that’s okay.
i want to create a shared server of git that is privately dedicated to our company, the thing is i want to store the file along side to the git index folder,

  • should i do that?
  • if not, and i should use --bare repositories how can get the file contents for each commit?

thanks in advance :smile:

You will need --bare if you need to push to that repo.

If you need files, check out from that repo using githooks.

http://git-scm.com/docs/githooks

If you have multiple report, you must consider gitlab, i was using gitosis, then --bare for years. Recently switched to gitlab, it is much easier to work + have project management features, was using redmine before.

so if i’m using gitlab for example, it will automatically handle pushes and stuff?
also is there anything in php or java because i want to make a few customization…

It will be better to use githook, that is simple. Gitlab have web hook, but for that to work, you need some kind of coding, it is like an API, so githook will be easier if on same server. If not do a croniob (this is what i do to deploy live site on a remote server from gitlab, not instant, but ok, i can do a git pull manually if change need to be verified).

I don’t know any PHP, Java solution for this.

i guess i’ll build my own script in PHP, so it will be easier for me to modify and so…
i have some other questions in that case

  • how can i list all the files for the commit?
  • how if possible, can i checkout a bare repo so i can zip/tarbal it?

If you need to make tar.gz, go to repo folder, then run

git archive --format tar.gz --output /path/to/file.tar.gz master

See more details at

http://git-scm.com/docs/git-archive

git active support other formats like zip, tar

[root@server12 ~]# git archive --list
tar
tgz
tar.gz
zip
[root@server12 ~]#

and what about the other question?

how can i list all the files for the commit?

by the way thanks for all the help :smile:

Try

 git show --pretty="format:" --name-only COMMIT_ID_HERE
1 Like