Hi all,
After a while without posting I'm back and we'll see how to serve a git-server through a ssh tunnel.
This is the easiest way to serve git to other users. It'll be quite a few steps, but in the end it'll be just nice to serve git to others.
We're assuming here you have some "untracked" source code and want to serve it through git. So let's start.
First of all, let's create a user to own our sources:
# adduser devel
And now add our own user to devel group:
# adduser username devel
We now create a folder called git inside /home/devel:
$ mkdir git
Obs: we're using user devel here.
Let's say our project name is 'Project', so let's create its gittree:
$ mkdir project.git
Obs: the .git at the end of project is needed
And now we initialize a bare git tree and share it to all group users:
$ cd project.gitproject.git$ git --bare init --shared=group
Now we go back to our user and initialize a git there. We'll also configure a remote called origin which is where we'll push our sources:
$ cd /path/to/our/sources$ git-init$ git-config remote.origin.url /home/devel/git/project.git/
Ok. We now have our local gittree initialized and ready to send patches to our git server but we have no commits in our tree (remember, we're assuming you have an untracked source code tree).
We need to add the files to our local gittree and start commiting them, after that we can push those commits to our local server tree:
$ git-add .$ git-commit -s
Obs: remember to clean-up your tree before git-add'ing the files. Whithout cleaning it up, you'll probably commit some garbage like .o files, ~ files, etc.
We now have an initial commit on the project, which we're gonna push to our server tree:
$ git-push origin master
And it's all done. We can use a gittree through a local server now. Next post we'll see how to serve it through SSH. It's quite simple once you really understand locally serving gittrees.
See y'all