Project

General

Profile

Git-maus » History » Version 26

Dobbs, Adam, 24 February 2017 19:45

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 25 Dobbs, Adam
The following sections will guide you to:
8 24 Dobbs, Adam
9
# Create an account on GitHub
10
# Add an ssh key to your account
11
# Fork the MAUS repository on github into your personal github account
12
# Make a local copy on your computer of your fork of MAUS
13 1 Dobbs, Adam
# Create a new development branch within this repository locally
14 26 Dobbs, Adam
# Make and changes and commit these changes to this branch
15 25 Dobbs, Adam
# Push your development branch and these changes to your github MAUS fork
16
# Propose merging your changes back to the MAUS trunk via github
17 1 Dobbs, Adam
18 2 Dobbs, Adam
h3. Set up a development branch
19
20 26 Dobbs, Adam
# Create an account on "github":https://github.com/
21 25 Dobbs, Adam
# "Add an ssh key":https://help.github.com/articles/connecting-to-github-with-ssh/ to your account
22 26 Dobbs, Adam
# Fork the MAUS repository on github into your personal github account
23 25 Dobbs, Adam
## Go to "MAUS github page":https://github.com/mice-software/maus and login into github
24 1 Dobbs, Adam
## Click "Fork" in the top right of the screen, selecting the option to fork to your own account
25 25 Dobbs, Adam
    !http://micewww.pp.rl.ac.uk/attachments/8360/GitHubForkScaled.png!
26 1 Dobbs, Adam
## Select your own account from the options that appear for where to fork MAUS
27 26 Dobbs, Adam
# Make a local copy (clone) on your computer of your fork of MAUS
28
## Copy the address of your new fork from github (something like @git@github.com:jbloggs/maus.git@, where jbloggs is your github username)
29
## Clone your repository:
30 1 Dobbs, Adam
<pre>
31 26 Dobbs, Adam
git clone git@github.com:jbloggs/maus.git
32 1 Dobbs, Adam
</pre>
33 2 Dobbs, Adam
where jbloggs is your github username.
34 26 Dobbs, Adam
# Create a new development branch within this repository locally
35
## cd into the directory created by the clone command (maus by default)
36
## Take a look at the branches present with:
37 2 Dobbs, Adam
<pre>
38 26 Dobbs, Adam
git branch -av
39
</pre>
40
## Pull down the merge branch from your remote github repository into the new local repository:
41
<pre>
42 1 Dobbs, Adam
git checkout merge
43 26 Dobbs, Adam
</pre>
44
## Create a new development branch in the local repository by forking the merge branch:
45
<pre>
46 1 Dobbs, Adam
git checkout -b my-feature-branch
47
</pre>
48 26 Dobbs, Adam
## Observe the new state of your local repository with:
49 1 Dobbs, Adam
<pre>
50 26 Dobbs, Adam
git branch -av
51
<pre>
52
# Optional: push your local development branch into your remote github repository
53
<pre>
54
git push origin my-feature-branch
55 2 Dobbs, Adam
</pre>
56 26 Dobbs, Adam
# Make changes and commit these changes to the local development branch
57
## Edit some files, creating some wonderful new feature for the benefit of mousekind
58
## Stage the changes:
59 2 Dobbs, Adam
<pre>
60 26 Dobbs, Adam
git add AlteredFile1.cc AlteredFile2.cc
61 2 Dobbs, Adam
</pre>
62 26 Dobbs, Adam
## Commit the changes:
63 2 Dobbs, Adam
<pre>
64 26 Dobbs, Adam
git commit -m 'My excellent new feature, closing issue ###'
65 2 Dobbs, Adam
</pre>
66 26 Dobbs, Adam
## Optional: push the changes to your remote development branch:
67 3 Dobbs, Adam
<pre>
68 26 Dobbs, Adam
git push origin my-feature-branch
69 3 Dobbs, Adam
</pre>
70 26 Dobbs, Adam
71
72 3 Dobbs, Adam
73
h3. Propose your branch for merging
74
75
* Run Jenkins test server job on your development branch (email the head of MAUS for help with setting up a test branch)
76
* When Jenkins has passed, return to your repository page on github and select @my-feature-branch@ from the drop-down menu on the left
77
* Click the "Pull request" button to propose merging into the trunk
78 1 Dobbs, Adam
* Make sure your branch is comfortable for merging - if not, edit some more until it is, commit and push, then try again