

- #Simple git server how to#
- #Simple git server full#
- #Simple git server software#
- #Simple git server windows#
Second step is to expose the folder with our newly created repository on the Windows share. There are two twists to the entire solution – one of them is – your shared repository needs to be initialized with –bare flag. The entire tricks works like this – expose folder containing your shared Git repository as Windows network share.

For that, there are plenty of resources on the Internet, including my own blogpost about Windows Git tooling. The guide assumes you already have your local Git set up. Recently I used it again on my current engagement, and one of my colleagues suggested I should blog it, so here goes.
#Simple git server software#
For our modest needs we experimented a little and came up with a solution that was very simple, didn’t require any additional software to be installed anywhere and worked like a charm. As I searched the Internet there were a few guides to set up team Git environment on Windows, but they all seemed very complicated and time consuming. The problem was, we weren’t allowed to use any third party provider, so GitHub was off the table. No need to maintain a gitlab instance if your needs are simple.Last year I found myself in a sudden and quick need to set up working environment for a team of four, and as I like Git very much, I wanted to use it as our VCS. You can create guest accounts that will only be able to see specific repositories, and they won't even know the other ones are here. Our users can now see, read and sometimes write into the repositories of our git server. # the end, to get the repo name as it is specified in gitolite conf
#Simple git server full#
# gitweb passes us the full repo path we need to strip the beginning and Use the gitolite command to find the values of the GL_ variables:Ĭonfigure gitweb in /usr/local/etc/nf: The Gitolite/GitWeb interaction is irrelevant to the webserver. # cp -r /usr/local/share/examples/git/gitweb /usr/local/ Make sure git is compiled with option GITWEB.Ĭopy the gitweb files where nginx will look for them: Let's try to clone a repository we're not allowed to see:įatal: remote error: FATAL: R any erika jean DENIED by fallthru # cd # vim # git add # git commit -m "Pushed from HTTP"

Remote: Total 3 (delta 0), reused 0 (delta 0) Let's clone a repository, add a commit and push it: Here we call gitolite-shell instead of git-http-backend directly to have gitolite check the users' permissions. Otherwise, SCRIPT_FILENAME will be set incorrectly and the shell will 403. # This include must be AFTER the above declaration. Use openssl passwd -apr1 to generate passwords.Īuth_basic_user_file /usr/local/etc/nginx/git_users.htpasswd įastcgi_param PATH_INFO $fastcgi_path_info įastcgi_param SCRIPT_FILENAME /usr/local/libexec/gitolite/gitolite-shell įastcgi_param QUERY_STRING $query_string įastcgi_param GIT_PROJECT_ROOT /home/gitolite/repositories įastcgi_param GIT_HTTP_BACKEND /usr/local/libexec/git-core/git-http-backend įastcgi_param GITOLITE_HTTP_HOME /home/gitolite

Jean:$apr1$fkADkYbl$Doen7IMxNwmD/r6X1LdM.1Įrika:$apr1$fOOlnSig$4PONnRHK3PMu8j1Hn圎Cc0 # make -C /usr/ports/# cat /usr/local/etc/nginx/git_users.htpasswd
#Simple git server how to#
I assume you already know how to install and do the basic configuration of nginx. Please make sure you have the correct access rights Try to clone repository erika_only with user jean:įATAL: R any erika_only jean DENIED by fallthruįatal: Could not read from remote repository. # git commit -m "Add users Jean and Erika."Ĭreate new repositories by setting their ACLs in the config file: # git clone two new keys (and thus users) and add them to the repository: Notice that the admin user can login using SSH, and that it will only execute gitolite's shell:Ĭommand="/usr/local/libexec/gitolite/gitolite-shell admin",no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty ssh-rsa = all you need to do on the server. % /usr/local/bin/gitolite setup -pk admin.pub Login as the UNIX user and initialize the system: That username will be considered the admin user.Ĭreate a UNIX user that will own the files: # make -C /usr/ports/devel/gitolite/ install cleanĬopy your public key on the server, naming it. It handles SSH connections and have the ACL functionality we're after.įirst, here's a good read about how gitolite works:
