Project

General

Profile

Repository » History » Version 25

Simó Albert i Beltran, 12/29/2012 01:07 PM
Fix feature branch example.

1 1 Pau Escrich
h1. Repository
2 1 Pau Escrich
3 1 Pau Escrich
h2. Structure
4 1 Pau Escrich
5 1 Pau Escrich
The qMp git repository is split in three branches:
6 1 Pau Escrich
7 1 Pau Escrich
# Master
8 1 Pau Escrich
# Testing
9 23 Simó Albert i Beltran
# Other: Features/Bugfixes
10 1 Pau Escrich
11 1 Pau Escrich
h3. Master
12 1 Pau Escrich
13 1 Pau Escrich
This is the main branch and all changes committed here must be tested in Testing branch before.
14 1 Pau Escrich
15 6 Simó Albert i Beltran
However the small bugfixes can be directly applied here. These changes must be merged in the testing branch.
16 1 Pau Escrich
17 10 Simó Albert i Beltran
<pre>
18 10 Simó Albert i Beltran
o---o---o---o---o master
19 10 Simó Albert i Beltran
                 \  
20 10 Simó Albert i Beltran
--o---o---o---o---o testing 
21 10 Simó Albert i Beltran
</pre>
22 10 Simó Albert i Beltran
23 22 Simó Albert i Beltran
*Example:*
24 22 Simó Albert i Beltran
@
25 22 Simó Albert i Beltran
git checkout testing
26 22 Simó Albert i Beltran
git merge master
27 22 Simó Albert i Beltran
@
28 22 Simó Albert i Beltran
29 22 Simó Albert i Beltran
30 1 Pau Escrich
h3. Testing
31 1 Pau Escrich
32 8 Simó Albert i Beltran
This is the branch for test new features and changes. The features must be already working features tested before in a specific branch by at least the developer. A feature can be committed here only when it is finished, but not in a middle state.
33 1 Pau Escrich
34 15 Simó Albert i Beltran
When the testing branch are deeply tested by more than one developer, than it can be merged on the master branch.
35 11 Simó Albert i Beltran
36 11 Simó Albert i Beltran
<pre>
37 11 Simó Albert i Beltran
o---o---o---o---o master
38 11 Simó Albert i Beltran
     \         /  
39 11 Simó Albert i Beltran
--o---o---o---o testing 
40 11 Simó Albert i Beltran
</pre>
41 11 Simó Albert i Beltran
42 16 Pau Escrich
*Example:*
43 11 Simó Albert i Beltran
44 16 Pau Escrich
Import master bugfixes to testing
45 18 Pau Escrich
@
46 16 Pau Escrich
git checkout master
47 16 Pau Escrich
git checkout testing
48 16 Pau Escrich
git merge master
49 18 Pau Escrich
@
50 16 Pau Escrich
51 16 Pau Escrich
Merge testing changes in master
52 19 Pau Escrich
@
53 16 Pau Escrich
git checkout master
54 16 Pau Escrich
git merge testing
55 19 Pau Escrich
@
56 16 Pau Escrich
57 12 Simó Albert i Beltran
h3. Other: Features/Bugfixes
58 1 Pau Escrich
59 8 Simó Albert i Beltran
The rest of the branches are temporal branches.
60 8 Simó Albert i Beltran
61 14 Simó Albert i Beltran
If it is about a new feature the name of the branch must be the name of the feature (of some name which identifies it). These branches are considered non-functional, so a non-finished feature can be committed here. This branch should preferably be based on a commit of master branch. Once the feature is finish and tested by at least the developer, it should be merged to testing.
62 1 Pau Escrich
63 9 Simó Albert i Beltran
<pre>
64 9 Simó Albert i Beltran
o---o---o---o---o master
65 14 Simó Albert i Beltran
     \
66 9 Simó Albert i Beltran
      o---o---o issue#23-new-feature
67 14 Simó Albert i Beltran
               \
68 9 Simó Albert i Beltran
o---o---o---o---o testing 
69 9 Simó Albert i Beltran
</pre>
70 9 Simó Albert i Beltran
71 16 Pau Escrich
*Example:*
72 9 Simó Albert i Beltran
73 24 Simó Albert i Beltran
@
74 24 Simó Albert i Beltran
git checkout -b issue#23-new-feature origin/master
75 24 Simó Albert i Beltran
editor dir/file
76 25 Simó Albert i Beltran
git add dir/file
77 24 Simó Albert i Beltran
git commit
78 24 Simó Albert i Beltran
#test issue#23-new-feature branch
79 24 Simó Albert i Beltran
git checkout testing
80 24 Simó Albert i Beltran
git merge issue#23-new-feature
81 24 Simó Albert i Beltran
@
82 24 Simó Albert i Beltran
83 24 Simó Albert i Beltran
84 21 Pau Escrich
A bugfix must be implemented in a new branch. This branch must be based on a commit of the master branch. This branch should not be based on a commit of the testing branch because it may contain new features and these maybe cannot be imported in the master branch. This new branch can be merged in testing.
85 7 Simó Albert i Beltran
86 7 Simó Albert i Beltran
<pre>
87 7 Simó Albert i Beltran
o---o---o---o---o master
88 1 Pau Escrich
     \         /
89 9 Simó Albert i Beltran
      o---o---o issue#23-bugfix
90 7 Simó Albert i Beltran
               \
91 7 Simó Albert i Beltran
o---o---o---o---o testing 
92 7 Simó Albert i Beltran
</pre>
93 16 Pau Escrich
94 16 Pau Escrich
*Example:*
95 1 Pau Escrich
96 1 Pau Escrich
h2. How to use it
97 1 Pau Escrich
98 2 Pau Escrich
99 2 Pau Escrich
h2. Good practices