Project

General

Profile

Development cycle » History » Version 3

Tom Clegg, 06/17/2011 03:38 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 3 Tom Clegg
Commit it.  If you refer to the issue# in the comment, redmine will notice this and do smart things (e.g., link to the commit from the issue page).
16 1 Tom Clegg
17
 git add ...
18 3 Tom Clegg
git commit -m 'description of stuff (closes #123)'
19 1 Tom Clegg
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