Projecte

General

Perfil

Repository » Historial » Versió 37

Simó Albert i Beltran, 07-03-2013 16:55
Typo.

1 1 Pau Escrich
h1. Repository
2
3 35 Simó Albert i Beltran
At the moment we work with a main branch, the master branch.
4
5 36 Simó Albert i Beltran
If you want solve a bug you could start a new branch based in a commit that introduces a bug or based in a head of master branch.
6
<pre>
7
     ----o issue#23
8
    /     \
9
o--o--o----o master
10
   ^
11
    commit with an error, it causes error described in issue 23.
12 37 Simó Albert i Beltran
</pre>
13 35 Simó Albert i Beltran
14
h1. Possible future workflow:
15
16 1 Pau Escrich
h2. Structure
17
18
The qMp git repository is split in three branches:
19
20
# Master
21
# Testing
22 23 Simó Albert i Beltran
# Other: Features/Bugfixes
23 1 Pau Escrich
24
h3. Master
25
26
This is the main branch and all changes committed here must be tested in Testing branch before.
27
28 6 Simó Albert i Beltran
However the small bugfixes can be directly applied here. These changes must be merged in the testing branch.
29 1 Pau Escrich
30 10 Simó Albert i Beltran
<pre>
31
o---o---o---o---o master
32
                 \  
33
--o---o---o---o---o testing 
34
</pre>
35
36 22 Simó Albert i Beltran
*Example:*
37 30 Anònim
<pre><code class="shell">
38 32 Simó Albert i Beltran
git checkout origin/testing
39
git merge origin/master
40 29 Simó Albert i Beltran
</code></pre>
41 22 Simó Albert i Beltran
42
43 1 Pau Escrich
h3. Testing
44
45 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.
46 1 Pau Escrich
47 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.
48 11 Simó Albert i Beltran
49
<pre>
50
o---o---o---o---o master
51
     \         /  
52
--o---o---o---o testing 
53
</pre>
54
55 16 Pau Escrich
*Example:*
56 11 Simó Albert i Beltran
57 16 Pau Escrich
Import master bugfixes to testing
58 30 Anònim
<pre><code class="shell">
59 32 Simó Albert i Beltran
git checkout origin/testing
60
git merge origin/master
61 29 Simó Albert i Beltran
</code></pre>
62 16 Pau Escrich
63
Merge testing changes in master
64 30 Anònim
<pre><code class="shell">
65 32 Simó Albert i Beltran
git checkout origin/master
66
git merge origin/testing
67 29 Simó Albert i Beltran
</code></pre>
68 16 Pau Escrich
69 12 Simó Albert i Beltran
h3. Other: Features/Bugfixes
70 1 Pau Escrich
71 8 Simó Albert i Beltran
The rest of the branches are temporal branches.
72
73 26 Simó Albert i Beltran
h4. Features
74
75 34 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 and other branches.
76 1 Pau Escrich
77 9 Simó Albert i Beltran
<pre>
78
o---o---o---o---o master
79 14 Simó Albert i Beltran
     \
80 9 Simó Albert i Beltran
      o---o---o issue#23-new-feature
81 14 Simó Albert i Beltran
               \
82 9 Simó Albert i Beltran
o---o---o---o---o testing 
83
</pre>
84
85 16 Pau Escrich
*Example:*
86 9 Simó Albert i Beltran
87 30 Anònim
<pre><code class="shell">
88 24 Simó Albert i Beltran
git checkout -b issue#23-new-feature origin/master
89
editor dir/file
90 25 Simó Albert i Beltran
git add dir/file
91 24 Simó Albert i Beltran
git commit
92
#test issue#23-new-feature branch
93 32 Simó Albert i Beltran
git checkout origin/testing
94 24 Simó Albert i Beltran
git merge issue#23-new-feature
95 29 Simó Albert i Beltran
</code></pre>
96 24 Simó Albert i Beltran
97 27 Simó Albert i Beltran
h4. Bugfixes
98 24 Simó Albert i Beltran
99 33 Simó Albert i Beltran
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 and other branches.
100 7 Simó Albert i Beltran
101
<pre>
102
o---o---o---o---o master
103 1 Pau Escrich
     \         /
104 9 Simó Albert i Beltran
      o---o---o issue#23-bugfix
105 7 Simó Albert i Beltran
               \
106
o---o---o---o---o testing 
107
</pre>
108 16 Pau Escrich
109
*Example:*
110 1 Pau Escrich
111 30 Anònim
<pre><code class="shell">
112 28 Simó Albert i Beltran
git checkout -b issue#23-bugfix origin/master
113
editor dir/file
114
git add dir/file
115
git commit
116
#test issue#23-bugfix branch
117
git checkout origin/testing
118
git merge issue#23-bugfix
119
git checkout origin/master
120
git merge issue#23-bugfix
121 29 Simó Albert i Beltran
</code></pre>
122 28 Simó Albert i Beltran
123
124 1 Pau Escrich
h2. How to use it
125
126 2 Pau Escrich
127
h2. Good practices