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