Git-maus » History » Version 30
Dobbs, Adam, 24 February 2017 20:04
1 | 1 | Dobbs, Adam | h1. Git-maus |
---|---|---|---|
2 | |||
3 | 5 | Dobbs, Adam | Besides Launchpad and bazaar MAUS has beta level support for git and"github":https://github.com/mice-software/maus. At the moment code updates for the trunk cannot be accepted from github however, only via Launchpad and bazaar. |
4 | 1 | Dobbs, Adam | |
5 | h2. Development |
||
6 | |||
7 | 28 | Dobbs, Adam | h3. Overview |
8 | 1 | Dobbs, Adam | |
9 | 28 | Dobbs, Adam | This following section will guide you to: |
10 | |||
11 | 24 | Dobbs, Adam | # Create an account on GitHub |
12 | # Add an ssh key to your account |
||
13 | # Fork the MAUS repository on github into your personal github account |
||
14 | # Make a local copy on your computer of your fork of MAUS |
||
15 | 1 | Dobbs, Adam | # Create a new development branch within this repository locally |
16 | 26 | Dobbs, Adam | # Make and changes and commit these changes to this branch |
17 | 1 | Dobbs, Adam | # Push your development branch and these changes to your github MAUS fork |
18 | 28 | Dobbs, Adam | # Create a Jenkins test server job for your development branch |
19 | 1 | Dobbs, Adam | # Propose merging your changes back to the MAUS trunk via github |
20 | |||
21 | 28 | Dobbs, Adam | h3. Step-by-step guide |
22 | 2 | Dobbs, Adam | |
23 | 26 | Dobbs, Adam | # Create an account on "github":https://github.com/ |
24 | 25 | Dobbs, Adam | # "Add an ssh key":https://help.github.com/articles/connecting-to-github-with-ssh/ to your account |
25 | 26 | Dobbs, Adam | # Fork the MAUS repository on github into your personal github account |
26 | 25 | Dobbs, Adam | ## Go to "MAUS github page":https://github.com/mice-software/maus and login into github |
27 | 1 | Dobbs, Adam | ## Click "Fork" in the top right of the screen, selecting the option to fork to your own account |
28 | 25 | Dobbs, Adam | !http://micewww.pp.rl.ac.uk/attachments/8360/GitHubForkScaled.png! |
29 | 1 | Dobbs, Adam | ## Select your own account from the options that appear for where to fork MAUS |
30 | 26 | Dobbs, Adam | # Make a local copy (clone) on your computer of your fork of MAUS |
31 | ## Copy the address of your new fork from github (something like @git@github.com:jbloggs/maus.git@, where jbloggs is your github username) |
||
32 | ## Clone your repository: |
||
33 | 1 | Dobbs, Adam | <pre> |
34 | 26 | Dobbs, Adam | git clone git@github.com:jbloggs/maus.git |
35 | 1 | Dobbs, Adam | </pre> |
36 | 2 | Dobbs, Adam | where jbloggs is your github username. |
37 | 26 | Dobbs, Adam | # Create a new development branch within this repository locally |
38 | ## cd into the directory created by the clone command (maus by default) |
||
39 | ## Take a look at the branches present with: |
||
40 | 2 | Dobbs, Adam | <pre> |
41 | 26 | Dobbs, Adam | git branch -av |
42 | </pre> |
||
43 | ## Pull down the merge branch from your remote github repository into the new local repository: |
||
44 | <pre> |
||
45 | 1 | Dobbs, Adam | git checkout merge |
46 | 26 | Dobbs, Adam | </pre> |
47 | ## Create a new development branch in the local repository by forking the merge branch: |
||
48 | <pre> |
||
49 | 1 | Dobbs, Adam | git checkout -b my-feature-branch |
50 | 27 | Dobbs, Adam | </pre> |
51 | 26 | Dobbs, Adam | ## Observe the new state of your local repository with: |
52 | <pre> |
||
53 | git branch -av |
||
54 | 2 | Dobbs, Adam | </pre> |
55 | 26 | Dobbs, Adam | # Make changes and commit these changes to the local development branch |
56 | ## Edit some files, creating some wonderful new feature for the benefit of mousekind |
||
57 | ## Stage the changes: |
||
58 | 2 | Dobbs, Adam | <pre> |
59 | 1 | Dobbs, Adam | git add AlteredFile1.cc AlteredFile2.cc |
60 | 2 | Dobbs, Adam | </pre> |
61 | 26 | Dobbs, Adam | ## Commit the changes: |
62 | 1 | Dobbs, Adam | <pre> |
63 | 2 | Dobbs, Adam | git commit -m 'My excellent new feature, closing issue ###' |
64 | 26 | Dobbs, Adam | </pre> |
65 | 28 | Dobbs, Adam | # Push your development branch and these changes to your github MAUS fork |
66 | 26 | Dobbs, Adam | <pre> |
67 | 3 | Dobbs, Adam | git push origin my-feature-branch |
68 | 26 | Dobbs, Adam | </pre> |
69 | 28 | Dobbs, Adam | # Create a Jenkins test server job for your development branch |
70 | ## The MAUS test server can be found at: "http://test.mice.rl.ac.uk":http://test.mice.rl.ac.uk |
||
71 | ## Either email the head of MAUS requesting a test branch and giving your repository url and development branch id, or go the test server, create a new item, copying an existing git-based test job, and edit the configuration with your repository url and branch name |
||
72 | 29 | Dobbs, Adam | # Propose merging your changes back to the MAUS trunk via github |
73 | 28 | Dobbs, Adam | ## Run the Jenkins test server job on your development branch |
74 | 30 | Dobbs, Adam | ## When Jenkins has passed (and not before), return to your repository page on github and select @my-feature-branch@ from the drop-down menu on the left (below is an example where the feature branch is named "event-selection") |
75 | !http://micewww.pp.rl.ac.uk/attachments/8362/GitHubBranchesScaled.png! |
||
76 | 28 | Dobbs, Adam | ## Click the "Pull request" button to propose merging into the trunk |
77 | ## Make sure your branch is comfortable for merging - if not, edit some more until it is, commit and push, then try again |