User Tools

Site Tools


services:rcs:start

This is an old revision of the document!


Using revision control systems

git on a shared grouphome

Using git, it's relatively simple and easy to set up a shared revision control system for a group using a folder which has read and write permissions for everyone who is a member of this group. At the Physics department, we have the grouphome folder which can be used for exactly this purpose.

First of all, open a terminal and open an SSH connection to login.physik.fu-berlin.de. Then change into your group's grouphome directory using the cd command, e.g. cd /net/grouphome/ag-test. Then issue the command git init –bare myrepo.git to create an empty git repository with the name myrepo:

This is already all that is needed to set up the shared git repository. Creating the git repository in your group's grouphome folder makes sure that the git repository is created with the proper permissions for everyone in your group to check out files/changes and commit them.

To use the newly created git repository, navigate back into your home directory using the cd command without any arguments. Then enter git clone ssh://grouphome.physik.fu-berlin.de/srv/grouphome/fbedv/myrepo.git to create a working copy of the myrepo.git repository in your home folder. Please note that by cloning the git repository from the grouphome folder, the .git suffix is automatically removed from the repository's folder name (the suffix .git is used to distinguish a bare repository from a local, working copy).

After cloning the myrepo repository, change into its folder and verify it's empty using the ls command:

Now we're going to demonstrate how to add a new file to the repository. For simplicity's sake, we just create a simple text file using the echo command. You may, of course, use any text editor or any other program to create files to be added to the git repository.

After creating a new file into the git repository folder, git is able to see that there a new, untracked files. This can be seen using git status (which is always very handy when checking the current status of the local working copy of the git repository).

Add the new file to the git repository by entering git add test.txt. You can issue git status again to verify the new file has now been staged for commit:

services/rcs/start.1418382216.txt.gz · Last modified: 2014/12/12 11:03 by glaubitz

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki