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