| 1 | === How to use the Repository on Jupiter === |
| 2 | |
| 3 | In this page we describe how to get access, the first thing you have to do (clone the repository) and how one should usually proceed to exchange new versions. |
| 4 | |
| 5 | == Getting access == |
| 6 | |
| 7 | In order to get access, you have to create a ssh-key and ask the system administrators to install it on the web server. They can assist you in creating it. Remember the secret pass phrase that you have to enter and don't give it away! |
| 8 | |
| 9 | == Cloning == |
| 10 | |
| 11 | The very first step on your local computer is as follows |
| 12 | {{{ |
| 13 | git clone git@jupiter:espack.git |
| 14 | }}} |
| 15 | This will ask you for your passphrase and will then count some objects, transfer them and after this you will find a new directory ''espack'' with some files and a sub folder ''.git'' in there. |
| 16 | |
| 17 | The second important step is to create your own branch to work. One important thing to understand about the version control system git, is that each of the coders has its complete own repository. There is basically no central instance. Jupiter just serves as another repository where we know that no changes to the code will appear (it is also marked as a ''bare'' repository). Hence, a branch that exists on Jupiter has nothing to do with branches of code on your computer (or harddrive rather). That's why we have to create a new branch: enter the espack directory and there type in the following |
| 18 | {{{ |
| 19 | git checkout <branch> -b <newname> |
| 20 | }}} |
| 21 | where <branch> is the name of the branch on jupiter and <newname> is the name of the branch you may choose as you wish. |
| 22 | |
| 23 | Note that by entering |
| 24 | {{{ |
| 25 | git branch -a |
| 26 | }}} |
| 27 | you may inspect all the branches there. The switch ''-a'' shows you all branches, all local ones and all remote ones that your git repository knows about. Remote ones are those on other computers, they are usually prefixed with ''origin/'' or something alike. |
| 28 | |
| 29 | == Coding == |
| 30 | |
| 31 | As you start coding in your new branch, from time to time '''commit'''! Committing often is very important! If possible try to dissect your changes to the code in tiny steps, such that each step can be compiled successfully and afterwards committed. The dream world would be that every commit is both compilable and all unit tests run fine. The latter may be disregarded if needs be, but successful compilation is a must! |
| 32 | |
| 33 | See the additional information in this [Wiki http://wissrech.ins.uni-bonn.de/inside/wikka/Git] for how to daily use git. |
| 34 | |
| 35 | == Exchanging versions ... == |
| 36 | |
| 37 | Parts of the code that have been implemented and tested successfully have to be broadcast to others. There are two ways to do this. |
| 38 | |
| 39 | = ... between users = |
| 40 | |
| 41 | This is easy if your computers reside in the same network (i.e. wiss-stud), just tell your colleague that he should pull one of your branches as this |
| 42 | {{{ |
| 43 | git pull ssh://adamantium:/home/<user>/<path>/ <name> |
| 44 | }}} |
| 45 | where ''<user>'' is your name and ''<path>'' the path to your local espack code and ''<name>'' finally is the name of your branch. |
| 46 | |
| 47 | It is however safer to proceed as follows: |
| 48 | 1. Setup a remote by giving git a shorthand of the above "ssh://.../" line, where <friend> should be a suitable name of your colleague as shorthand reference. |
| 49 | {{{ |
| 50 | git remote add <friend> ssh://.../ |
| 51 | }}} |
| 52 | |
| 53 | = ... with the jupiter repository = |
| 54 | |
| 55 | Here, you tell the repository administrator that he should pull one of your branches in the same manner as above. He will check your code and if it is fine, push it onto the jupiter repository. '''Note that you should never ever push yourself branches thereto!''' (except of course you are the administrator :). |
| 56 | |