services:rcs:start
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
services:rcs:start [2014/12/12 11:03] – glaubitz | services: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 // | 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 // | ||
+ | |||
+ | ==== Creating the shared git repository on the server ==== | ||
First of all, open a terminal and open an SSH connection to // | First of all, open a terminal and open an SSH connection to // | ||
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' | This is already all that is needed to set up the shared git repository. Creating the git repository in your group' | ||
+ | |||
+ | ==== 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: | 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: | ||
Line 16: | Line 20: | ||
{{: | {{: | ||
+ | |||
+ | ==== 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' | Now we're going to demonstrate how to add a new file to the repository. For simplicity' | ||
Line 26: | Line 32: | ||
{{: | {{: | ||
+ | |||
+ | To commit the changes, type //git commit -m " | ||
+ | |||
+ | **Note**: Unlike //cvs// or //svn//, anything that has been committed is not automatically pushed to the remote repository on the server (in this case, the repository in the grouphome folder). To push the changes to the remote repository, we use the command //git push//, see below. | ||
{{: | {{: | ||
+ | |||
+ | Before we push the changes to the remote repository, we can verify the changes using the command //git log// (here piped to the command //cat// to avoid displaying the git log in the //less// pager). | ||
{{: | {{: | ||
+ | |||
+ | ==== 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). | ||
+ | |||
+ | //git remote// lists the remote repositories that are currently available (additional can be defined using //git remote add//) while //git branch -a// lists the available branches. | ||
+ | |||
+ | Thus, in this case we need to run //git push origin master// to push our changes to the repository in the grouphome folder: | ||
{{: | {{: | ||
+ | |||
+ | 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/start.txt · Last modified: 2014/12/15 09:09 by behrmj87