Development cycle » History » Version 2
Ward Vandewege, 06/08/2011 04:03 PM
1 | 1 | Tom Clegg | h1. Development cycle |
---|---|---|---|
2 | |||
3 | h2. Writing and contributing code |
||
4 | |||
5 | Start a branch like username/master or username/rails3 |
||
6 | |||
7 | git branch example/rails3 |
||
8 | git checkout example/rails3 |
||
9 | |||
10 | Do something trivial like |
||
11 | |||
12 | * add app/views/pages/specimen_collection.html.erb |
||
13 | * add link to it in app/views/pages/home.html.erb |
||
14 | |||
15 | Commit it |
||
16 | |||
17 | git add ... |
||
18 | git commit -m '...' |
||
19 | |||
20 | Push it |
||
21 | |||
22 | git push |
||
23 | |||
24 | Generate a pull request |
||
25 | |||
26 | git request-pull e68ab19^ git@git.clinicalfuture.com:pgp-enroll.git e68ab19 |
||
27 | |||
28 | Send the pull request to someone like Ward |
||
29 | |||
30 | h2. Merging code from other contributors/branches |
||
31 | |||
32 | 2 | Ward Vandewege | Add other developer branch if you don't have it yet |
33 | 1 | Tom Clegg | |
34 | git pull |
||
35 | |||
36 | 2 | Ward Vandewege | Switch to the other branch |
37 | 1 | Tom Clegg | |
38 | 2 | Ward Vandewege | git checkout origin/example/rails3 |
39 | 1 | Tom Clegg | |
40 | 2 | Ward Vandewege | (git will complain about being in a detached head state, but that's fine - just don't commit to this state) |
41 | |||
42 | Now look around, test |
||
43 | |||
44 | git log |
||
45 | |||
46 | Switch to production branch |
||
47 | |||
48 | git checkout rails3 |
||
49 | |||
50 | 1 | Tom Clegg | Cherry-pick a commit |
51 | |||
52 | git cherry-pick e68ab19 |
||
53 | |||
54 | 2 | Ward Vandewege | Or merge the entire remote tree (this will fetch and merge but not yet commit) |
55 | |||
56 | git merge --no-commit origin/tomc/rails3 |
||
57 | |||
58 | When you're happy, |
||
59 | |||
60 | git commit |
||
61 | |||
62 | Or rewind |
||
63 | |||
64 | git reset --hard rails3 |
||
65 | |||
66 | Finally, push |
||
67 | 1 | Tom Clegg | |
68 | git push |