blob: 95d274a7a2c70bf3b635b4cda07bc6c495af01ad [file] [log] [blame]
Brian464e3632006-12-05 16:14:14 -07001<HTML>
2
Brian Paul1a366702010-02-05 13:18:31 -07003<TITLE>Code Repository</TITLE>
Brian464e3632006-12-05 16:14:14 -07004
5<link rel="stylesheet" type="text/css" href="mesa.css"></head>
6
7<BODY>
8
9<h1>Code Repository</h1>
10
11<p>
Brian Pauld23fefe2010-02-11 09:02:53 -070012Mesa uses <a href="http://git.or.cz/"target="_parent">git</a>
Brian464e3632006-12-05 16:14:14 -070013as its source code management system.
Brian464e3632006-12-05 16:14:14 -070014</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://gitweb.freedesktop.org/?p=mesa/mesa.git"
30target="_parent">browse the git repository</a>.
31</p>
32
33
34<a name="anonymous">
35<H2>Anonymous git Access</H2>
36
37<p>
38To 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>
58Mesa developers need to first have an account on
59<a href="http://www.freedesktop.org" target="_parent">freedesktop.org</a>.
60To get an account, please ask Brian or the other Mesa developers for
61permission.
62Then, if there are no objections, follow this
63<a href="http://www.freedesktop.org/wiki/AccountRequests" target="_parent">
64procedure</a>.
65</p>
66
67<p>
68Once 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
Brianddbfa8c2008-02-28 08:03:04 -070085<H2>Windows Users</H2>
86
87<p>
88If you're <a href="http://git.or.cz/gitwiki/WindowsInstall" target="_parent">
89using git on Windows</a> you'll want to enable automatic CR/LF conversion in
90your local copy of the repository:
91</p>
92<pre>
93 git config --global core.autocrlf true
94</pre>
95
96<p>
97This will cause git to convert all text files to CR+LF on checkout,
98and to LF on commit.
99</p>
100<p>
101Unix users don't need to set this option.
102</p>
103<br>
104
105
Brian464e3632006-12-05 16:14:14 -0700106<a name="developer">
107<H2>Development Branches</H2>
108
109<p>
110At any given time, there may be several active branches in Mesa's
111repository.
112Generally, the trunk contains the latest development (unstable)
113code while a branch has the latest stable code.
114</p>
115
116<p>
Brian18e9ca52007-02-20 09:24:06 -0700117The command <code>git-branch</code> will list all available branches.
118</p>
119
120<p>
121Questions about branch status/activity should be posted to the
122mesa3d-dev mailing list.
Brian464e3632006-12-05 16:14:14 -0700123</p>
124
Karl Schultz207ad942010-02-11 10:54:18 -0700125<H2>Developer Git Tips</H2>
126
127<ol>
128<li>Setting up to edit the master branch
129<p>
130If you try to do a pull by just saying<code> git pull </code>
131and git complains that you have not specified a
132branch, try:
133<pre>
134 git config branch.master.remote origin
135 git config branch.master.merge master
136</pre>
137Otherwise, you have to say<code> git pull origin master </code>
138each time you do a pull.
139</p>
140<li>Small changes to master
141<p>
142If you are an experienced git user working on substancial modifications,
143you are probably
144working on a separate branch and would rebase your branch prior to
145merging with master.
146But for small changes to the master branch itself,
147you also need to use the rebase feature in order to avoid an
148unnecessary and distracting branch in master.
149</p>
150<p>
151If it has been awhile since you've done the initial clone, try
152<pre>
153 git pull
154</pre>
155to get the latest files before you start working.
156</p>
157<p>
158Make your changes and use
159<pre>
160 git add &lt;files to commit&gt;
161 git commit
162</pre>
163to get your changes ready to push back into the fd.o repository.
164</p>
165<p>
166It is possible (and likely) that someone has changed master since
167you did your last pull. Even if your changes do not conflict with
168their changes, git will make a fast-forward
169merge branch, branching from the point in time
170where you did your last pull and merging it to a point after the other changes.
171</p>
172<p>
173To avoid this,
174<pre>
175 git pull --rebase
176 git push
177</pre>
178If 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
180the 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
182to explain it.)
183</br>
184In any case, your repository now looks like you made your changes after
185all the other changes.
186</p>
187<p>
188If the rebase resulted in conflicts or changes that could affect
189the proper operation of your changes, you'll need to investigate
190those before doing the push.
191</p>
192<p>
193If 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>
199See <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>
Brian464e3632006-12-05 16:14:14 -0700202
203</body>
204</html>
205
206