User Tools

Site Tools


services:rcs:start

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
services:rcs:start [2014/12/12 13:19] glaubitzservices:rcs:start [2014/12/12 13:26] glaubitz
Line 4: Line 4:
  
 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. 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.
 +
 +==== Creating the shared git repository on the server ====
  
 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//: 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//:
Line 10: Line 12:
  
 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. 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.
 +
 +==== Clone a local working copy of the repository on the server ====
  
 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). 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).
Line 16: Line 20:
  
 {{:services:rcs:git-grouphome-step2.png|}} {{:services:rcs:git-grouphome-step2.png|}}
 +
 +==== Making changes and committing them to the local working copy ====
  
 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. 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.
Line 36: Line 42:
  
 {{:services:rcs:git-grouphome-step6.png|}} {{:services:rcs:git-grouphome-step6.png|}}
 +
 +==== Push the local changes to the repository on the server ====
  
 To push the changes to the server, we use //git push//. The //push// command requires information about the remote repository to be used (called //origin// by default) as well as the development branch to be pushed to the server (//master// by default if you didn't specify any additional branches). To push the changes to the server, we use //git push//. The //push// command requires information about the remote repository to be used (called //origin// by default) as well as the development branch to be pushed to the server (//master// by default if you didn't specify any additional branches).
Line 44: Line 52:
  
 {{:services:rcs:git-grouphome-step7.png|}} {{:services:rcs:git-grouphome-step7.png|}}
 +
 +This is all that's needed to set up a remote git repository, clone a local working copy as well as push changes to the server. The rest of the description now describes how a second user can clone the repository, make their changes, push them and have the first user copy those new changes to their local repository using the //git pull// commmand.
 +
 +==== Collaborating with other users ====
  
 {{:services:rcs:git-grouphome-step8.png|}} {{:services:rcs:git-grouphome-step8.png|}}
services/rcs/start.txt · Last modified: 2014/12/15 09:09 by behrmj87

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki