2 Gtk‎ > ‎2 Tutorials‎ > ‎Collaboration‎ > ‎

3. Repository initialization

Note: Newer versions of git, and Bibledit-Gtk version 4.2 and higher, no longer need what is written below.

In this tutorial you are going to see whether the repository can be cloned, and if not, then to put some data into it, then try to clone it again to see how it now goes.

Open a terminal, and issue the commands as given.


In the tutorial about setting up the repository, the systems administrator had given the URL of the repository that was created. In the current tutorial we assume a URL of "file:///media/usbstick/repository". Of course others are possible, depending on what type of repository you have and where it resides. For example "ssh://user@repo2.git.sourceforge.net/gitroot/repo2/repo2".

You need to put something into the repository. It does not matter what, anything will do. Let's proceed and put an empty file into the repository. Issue the commands as given:
mkdir repository
cd repository
git init

It will say that an empty Git repository was initialized.

touch file
git add file
git commit -a -m init

It will say that an initial commit was created.

git push --all file:///media/usbstick/repository
    or for secure network repository:
    git push --all ssh://sforgeuser@.repo2.git.sourceforge.net/gitroot/repo2/repo2

It will give some information, which shows that data was written to the repository. No errors should occur. Example:

Counting objects: 3, done.
Writing objects: 100% (3/3), 198 bytes, done.
Total 3 (delta 0), reused 0 (delta 0)
To ssh://warpok@tsederhana.git.sourceforge.net/gitroot/tsederhana/tsederhana
 * [new branch]      master -> master

Clean out the temporal directory:

rm -rf repository

Now try to clone the repository:

git clone file:///media/usbstick/repository
    or for secure network repostory:
    git clone ssh://sforgeuser@repo2.git.sourceforge.net/gitroot/repo2/repo2

It should say that an empty Git repository was created, give some more information, and show that object were received. It is does this, and there are no errors, then everything is fine. Your repository has been initialized. Example:

Initialized empty Git repository in /home/oreo/tsederhana/.git/
remote: Counting objects: 3, done.
remote: Total 3 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (3/3), done.