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 10:00] – glaubitz | services:rcs:start [2014/12/12 13:50] – added switch --shared to git init, this helps users of shared repos to not shoot themselved in the foot behrmj87 | ||
---|---|---|---|
Line 3: | Line 3: | ||
===== git on a shared grouphome ===== | ===== git on a shared grouphome ===== | ||
+ | Using '' | ||
+ | |||
+ | ==== Creating the shared git repository on the server ==== | ||
+ | |||
+ | First of all, open a terminal and open an SSH connection to // | ||
+ | |||
+ | {{: | ||
+ | |||
+ | 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 '' | ||
+ | |||
+ | After cloning the //myrepo// repository, change into its folder and verify it's empty using the '' | ||
+ | |||
+ | {{: | ||
+ | |||
+ | ==== 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' | ||
+ | |||
+ | 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 '' | ||
+ | |||
+ | {{: | ||
+ | |||
+ | Add the new file to the git repository by entering '' | ||
+ | |||
+ | {{: | ||
+ | |||
+ | To commit the changes, type '' | ||
+ | |||
+ | **Note**: Unlike '' | ||
+ | |||
+ | {{: | ||
+ | |||
+ | Before we push the changes to the remote repository, we can verify the changes using the command '' | ||
+ | |||
+ | {{: | ||
+ | |||
+ | ==== Push the local changes to the repository on the server ==== | ||
+ | |||
+ | To push the changes to the server, we use '' | ||
+ | |||
+ | '' | ||
+ | |||
+ | Thus, in this case we need to run '' | ||
+ | |||
+ | {{: | ||
+ | |||
+ | 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 '' | ||
+ | |||
+ | ==== Collaborating with other users ==== | ||
+ | |||
+ | This section shall demonstrate how a second user would clone the repository from the server, make changes, commit them and eventually push them back to the repository. | ||
+ | |||
+ | To simulate this scenario in this example, we just create a new empty folder called //repo2// where we clone a second local working copy into. This is basically the same as if a second user clones the remote repository into their home directory. | ||
+ | |||
+ | To clone the remote repository we just created, it's best practice to specify the remote repository using the full hostname of the server (servername + domain) as well as the full path on the server (as opposed to using ''/ | ||
+ | |||
+ | After cloning, we change into the //myrepo// directory of the repository and verify the commit history using the already known '' | ||
+ | |||
+ | {{: | ||
+ | |||
+ | {{: | ||
+ | |||
+ | {{: |
services/rcs/start.txt · Last modified: 2014/12/15 09:09 by behrmj87