Merge branch 'gallium-dynamicstencilref'
[mesa.git] / docs / repository.html
1 <HTML>
2
3 <TITLE>Code Repository</TITLE>
4
5 <link rel="stylesheet" type="text/css" href="mesa.css"></head>
6
7 <BODY>
8
9 <h1>Code Repository</h1>
10
11 <p>
12 Mesa uses <a href="http://git.or.cz/"target="_parent">git</a>
13 as its source code management system.
14 </p>
15
16 The master git repository is hosted on
17 <a href="http://www.freedesktop.org" target="_parent">freedesktop.org</a>.
18 </p>
19
20 <p>
21 You may access the repository either as an
22 <a href="#anonymous">anonymous user</a> (read-only) or as a
23 <a href="#developer">developer</a>
24 (read/write).
25 </p>
26
27 <p>
28 You may also
29 <a href="http://gitweb.freedesktop.org/?p=mesa/mesa.git"
30 target="_parent">browse the git repository</a>.
31 </p>
32
33
34 <a name="anonymous">
35 <H2>Anonymous git Access</H2>
36
37 <p>
38 To get the Mesa sources anonymously (read-only):
39 </p>
40
41 <ol>
42 <li>Install the git software on your computer if needed.<br><br>
43 <li>Get an initial, local copy of the repository with:
44 <pre>
45 git clone git://anongit.freedesktop.org/git/mesa/mesa
46 </pre>
47 <li>Later, you can update your tree from the master repository with:
48 <pre>
49 git pull origin
50 </pre>
51 </ol>
52
53
54 <a name="developer">
55 <H2>Developer git Access</H2>
56
57 <p>
58 Mesa developers need to first have an account on
59 <a href="http://www.freedesktop.org" target="_parent">freedesktop.org</a>.
60 To get an account, please ask Brian or the other Mesa developers for
61 permission.
62 Then, if there are no objections, follow this
63 <a href="http://www.freedesktop.org/wiki/AccountRequests" target="_parent">
64 procedure</a>.
65 </p>
66
67 <p>
68 Once your account is established:
69 </p>
70
71 <ol>
72 <li>Install the git software on your computer if needed.<br><br>
73 <li>Get an initial, local copy of the repository with:
74 <pre>
75 git clone git+ssh://username@git.freedesktop.org/git/mesa/mesa
76 </pre>
77 Replace <em>username</em> with your actual login name.<br><br>
78 <li>Later, you can update your tree from the master repository with:
79 <pre>
80 git pull origin
81 </pre>
82 </ol>
83
84
85 <H2>Windows Users</H2>
86
87 <p>
88 If you're <a href="http://git.or.cz/gitwiki/WindowsInstall" target="_parent">
89 using git on Windows</a> you'll want to enable automatic CR/LF conversion in
90 your local copy of the repository:
91 </p>
92 <pre>
93 git config --global core.autocrlf true
94 </pre>
95
96 <p>
97 This will cause git to convert all text files to CR+LF on checkout,
98 and to LF on commit.
99 </p>
100 <p>
101 Unix users don't need to set this option.
102 </p>
103 <br>
104
105
106 <a name="developer">
107 <H2>Development Branches</H2>
108
109 <p>
110 At any given time, there may be several active branches in Mesa's
111 repository.
112 Generally, the trunk contains the latest development (unstable)
113 code while a branch has the latest stable code.
114 </p>
115
116 <p>
117 The command <code>git-branch</code> will list all available branches.
118 </p>
119
120 <p>
121 Questions about branch status/activity should be posted to the
122 mesa3d-dev mailing list.
123 </p>
124
125 <H2>Developer Git Tips</H2>
126
127 <ol>
128 <li>Setting up to edit the master branch
129 <p>
130 If you try to do a pull by just saying<code> git pull </code>
131 and git complains that you have not specified a
132 branch, try:
133 <pre>
134 git config branch.master.remote origin
135 git config branch.master.merge master
136 </pre>
137 Otherwise, you have to say<code> git pull origin master </code>
138 each time you do a pull.
139 </p>
140 <li>Small changes to master
141 <p>
142 If you are an experienced git user working on substancial modifications,
143 you are probably
144 working on a separate branch and would rebase your branch prior to
145 merging with master.
146 But for small changes to the master branch itself,
147 you also need to use the rebase feature in order to avoid an
148 unnecessary and distracting branch in master.
149 </p>
150 <p>
151 If it has been awhile since you've done the initial clone, try
152 <pre>
153 git pull
154 </pre>
155 to get the latest files before you start working.
156 </p>
157 <p>
158 Make your changes and use
159 <pre>
160 git add &lt;files to commit&gt;
161 git commit
162 </pre>
163 to get your changes ready to push back into the fd.o repository.
164 </p>
165 <p>
166 It is possible (and likely) that someone has changed master since
167 you did your last pull. Even if your changes do not conflict with
168 their changes, git will make a fast-forward
169 merge branch, branching from the point in time
170 where you did your last pull and merging it to a point after the other changes.
171 </p>
172 <p>
173 To avoid this,
174 <pre>
175 git pull --rebase
176 git push
177 </pre>
178 If you are familiar with CVS or similar system, this is similar to doing a
179 <code> cvs update </code> in order to update your source tree to
180 the current repository state, instead of the time you did the last update.
181 (CVS doesn't work like git in this respect, but this is easiest way
182 to explain it.)
183 </br>
184 In any case, your repository now looks like you made your changes after
185 all the other changes.
186 </p>
187 <p>
188 If the rebase resulted in conflicts or changes that could affect
189 the proper operation of your changes, you'll need to investigate
190 those before doing the push.
191 </p>
192 <p>
193 If you want the rebase action to be the default action, then
194 <pre>
195 git config branch.master.rebase true
196 git config --global branch.autosetuprebase=always
197 </pre>
198 <p>
199 See <a href="http://www.eecs.harvard.edu/~cduan/technical/git/" target="_parent">Understanding Git Conceptually</a> for a fairly clear explanation about all of this.
200 </p>
201 </ol>
202
203 </body>
204 </html>
205
206