In the example below we will setup a basic system using one server that has the data repository, and two users.
Collaboration using Git needs one computer that will be the server. This can be a separate computer, or the computer of one of the users. In this example we will use the computer of one of the users. By doing so we only need two computers to demonstrate everything. We will use Jim's computer to serve the repository.
On this computer, do the following to setup the server.
Login as user jim.
Open a terminal
We will create an shared repository in /home/jim/git/repository, and fetch the data of Jim's project "Ndebele" into it. To do that, type
mkdir -p /home/jim/git/repository cd /home/jim/git/repository git --bare init --shared git --bare fetch /home/jim/.bibledit/projects/Ndebele/data master:master
To make the repository available to the network, type
git-daemon --export-all --base-path=/home/jim/git --detach --enable=receive-pack
It is recommended to put the command that starts the daemon in the boot script.
To test access to the new repository, type
git-ls-remote git://localhost/repository
If everthing is fine, no errors will occur and a few commits will be listed.
We are now going to setup the first user. This will be Jim in our example. His computer already is used as a server, but Jim also works on it using Bibledit.
In Bibledit, Jim opens the project he wishes to share with others.
He goes to menu Preferences / Git repository.
In that dialog, he ticks "Use remote repository".
Under "Repository", he enters git://localhost/repository
In the dialog he verifies that write access has been granted.
He then ticks "Push my data to the repository".
He then clicks OK.
This finishes the setup of the first user. Jim can now work on Bibledit as before, and his data will be automatically updated in the repository.
We are now going to setup the second user. This will be John in our example. He uses another workstation, is connected to the network, and can access Jim's computer through that network.
John starts Bibledit, and creates a new empty project, named after the project that Jim put in the repository.
He goes to menu Preferences / Git repository.
In that dialog, he ticks "Use remote repository".
Under "Repository", he needs to enter the name of Jim's server.
He asks Jim for the IP address of his computer. Jim logs in as root, and types ifconfig, notices under "eth0" that his computer has IP address 192.168.0.6. He passes this number on to John.
Under "Repository", John enters git://192.168.0.6/repository
In the dialog he verifies that write access has been granted.
He then ticks "Copy repository to local data". This is to import all data from the repository into his own project.
He then clicks OK.
This finishes the setup of the second user. John can now work on Bibledit as before, and his data will be automatically updated in the repository.
Setting up a third user, a fourth, and so on, goes the same as setting up the second user.