1 <!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.0 Transitional//EN"
2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3 <html xmlns=
"http://www.w3.org/1999/xhtml" xml:
lang=
"en"
6 <meta http-equiv=
"Content-Type" content=
"text/html; charset=utf-8" />
7 <title>geda:scm
</title>
8 <meta name=
"generator" content=
"DokuWiki Release rc2007-05-24" />
9 <meta name=
"robots" content=
"noindex,nofollow" />
10 <meta name=
"date" content=
"2007-07-04T19:34:57-0400" />
11 <meta name=
"keywords" content=
"geda,scm" />
12 <link rel=
"search" type=
"application/opensearchdescription+xml" href=
"http://geda.seul.org/wiki/lib/exe/opensearch.php" title=
"geda Wiki" />
13 <link rel=
"start" href=
"http://geda.seul.org/wiki/" />
14 <link rel=
"contents" href=
"http://geda.seul.org/wiki/geda:scm?do=index" title=
"Index" />
15 <link rel=
"alternate" type=
"application/rss+xml" title=
"Recent Changes" href=
"http://geda.seul.org/wiki/feed.php" />
16 <link rel=
"alternate" type=
"application/rss+xml" title=
"Current Namespace" href=
"http://geda.seul.org/wiki/feed.php?mode=list&ns=geda" />
17 <link rel=
"alternate" type=
"text/html" title=
"Plain HTML" href=
"http://geda.seul.org/wiki/_export/xhtml/geda:scm" />
18 <link rel=
"alternate" type=
"text/plain" title=
"Wiki Markup" href=
"http://geda.seul.org/wiki/_export/raw/geda:scm" />
19 <link rel=
"stylesheet" media=
"all" type=
"text/css" href=
"lib/exe/css" />
20 <link rel=
"stylesheet" media=
"screen" type=
"text/css" href=
"lib/exe/001css" />
21 <link rel=
"stylesheet" media=
"print" type=
"text/css" href=
"lib/exe/002css" />
24 <div class=
"dokuwiki export">
26 <div class=
"tocheader toctoggle" id=
"toc__header">Table of Contents
</div>
27 <div id=
"toc__inside">
30 <li class=
"level1"><div class=
"li"><span class=
"li"><a href=
"#geda_gaf_s_source_control_management" class=
"toc">gEDA/gaf
's Source Control Management
</a></span></div>
32 <li class=
"level2"><div class=
"li"><span class=
"li"><a href=
"#installing_git_related_tools" class=
"toc">Installing git
& related tools
</a></span></div>
34 <li class=
"level3"><div class=
"li"><span class=
"li"><a href=
"#debian-based" class=
"toc">Debian-based
</a></span></div></li>
35 <li class=
"level3"><div class=
"li"><span class=
"li"><a href=
"#fedora_linux" class=
"toc">Fedora Linux
</a></span></div></li>
38 <li class=
"level2"><div class=
"li"><span class=
"li"><a href=
"#learning_to_use_git" class=
"toc">Learning to use git
</a></span></div></li>
39 <li class=
"level2"><div class=
"li"><span class=
"li"><a href=
"#accessing_the_repository" class=
"toc">Accessing the repository
</a></span></div></li>
40 <li class=
"level2"><div class=
"li"><span class=
"li"><a href=
"#making_and_committing_changes" class=
"toc">Making and committing changes
</a></span></div>
42 <li class=
"level3"><div class=
"li"><span class=
"li"><a href=
"#setting_up_user_information" class=
"toc">Setting up user information
</a></span></div></li>
43 <li class=
"level3"><div class=
"li"><span class=
"li"><a href=
"#committing_patches_from_other_contributors" class=
"toc">Committing patches from other contributors
</a></span></div></li>
44 <li class=
"level3"><div class=
"li"><span class=
"li"><a href=
"#writing_good_commit_messages" class=
"toc">Writing good commit messages
</a></span></div></li>
45 <li class=
"level3"><div class=
"li"><span class=
"li"><a href=
"#push_is_destructive" class=
"toc">Push is Destructive
</a></span></div></li>
48 <li class=
"level2"><div class=
"li"><span class=
"li"><a href=
"#how_do_i" class=
"toc">How Do I ... ?
</a></span></div>
50 <li class=
"level3"><div class=
"li"><span class=
"li"><a href=
"#get_a_copy_of_geda_gaf_git_repository" class=
"toc">... get a copy of gEDA/gaf git repository?
</a></span></div></li>
51 <li class=
"level3"><div class=
"li"><span class=
"li"><a href=
"#keep_my_local_copy_current" class=
"toc">... keep my local copy current?
</a></span></div></li>
52 <li class=
"level3"><div class=
"li"><span class=
"li"><a href=
"#commit_my_changes_to_the_local_git_repository" class=
"toc">... commit my changes to the local git repository?
</a></span></div></li>
53 <li class=
"level3"><div class=
"li"><span class=
"li"><a href=
"#undo_any_uncommitted_local_changes" class=
"toc">... undo any uncommitted local changes?
</a></span></div></li>
54 <li class=
"level3"><div class=
"li"><span class=
"li"><a href=
"#fix_change_my_last_commit" class=
"toc">... fix/change my last commit?
</a></span></div></li></ul>
62 <h1><a name=
"geda_gaf_s_source_control_management" id=
"geda_gaf_s_source_control_management">gEDA/gaf
's Source Control Management
</a></h1>
66 gEDA uses
<strong>git
</strong> for source code management. git is a distributed version control system, where every user has his or her own full copy of the revision history.
69 <li class=
"level1"><div class=
"li"> <a href=
"http://git.or.cz/" class=
"urlextern" title=
"http://git.or.cz/" rel=
"nofollow">Official git website
</a></div>
71 <li class=
"level1"><div class=
"li"> <a href=
"http://www.kernel.org/pub/software/scm/git/docs/" class=
"urlextern" title=
"http://www.kernel.org/pub/software/scm/git/docs/" rel=
"nofollow">git documentation online
</a></div>
73 <li class=
"level1"><div class=
"li"> <a href=
"http://en.wikipedia.org/wiki/Git_(software)" class=
"urlextern" title=
"http://en.wikipedia.org/wiki/Git_(software)" rel=
"nofollow">git Wikipedia page
</a></div>
78 The web interface to the gEDA git repository is at
<a href=
"http://git.gpleda.org/" class=
"urlextern" title=
"http://git.gpleda.org/" rel=
"nofollow">http://git.gpleda.org/
</a>.
82 <!-- SECTION "gEDA/gaf's Source Control Management" [1-493] -->
83 <h2><a name=
"installing_git_related_tools" id=
"installing_git_related_tools">Installing git
& related tools
</a></h2>
87 The core git tools are of course required for using the repository, and the documentation is always useful. However, other tools are often helpful for working with git:
90 <li class=
"level1"><div class=
"li"> gitk, a visual history repository browser
</div>
92 <li class=
"level1"><div class=
"li"> <a href=
"http://git.or.cz/cogito/" class=
"urlextern" title=
"http://git.or.cz/cogito/" rel=
"nofollow">Cogito
</a>, a more user-friendly front-end to git
</div>
94 <li class=
"level1"><div class=
"li"> <a href=
"http://www.procode.org/stgit/" class=
"urlextern" title=
"http://www.procode.org/stgit/" rel=
"nofollow">Stacked Git
</a>, for working with patchsets
</div>
99 Make sure that you install at least version
1.5.x of git if you are planning on pushing changes to the central git repository.
103 <!-- SECTION "Installing git & related tools" [494-1042] -->
104 <h3><a name=
"debian-based" id=
"debian-based">Debian-based
</a></h3>
106 <pre class=
"code">apt-get install git-core git-doc gitk cogito stgit
</pre>
111 <pre class=
"code">apt-get install git-email git-completion
</pre>
114 Note, as of
2007/
06/
25, Debian stable (etch) and Debian testing (lenny) have git version
1.4.x. Debian unstable (sid) has
1.5.2.2.
118 <!-- SECTION "Debian-based" [1043-1317] -->
119 <h3><a name=
"fedora_linux" id=
"fedora_linux">Fedora Linux
</a></h3>
121 <pre class=
"code">yum install git cogito stgit
</pre>
124 <!-- SECTION "Fedora Linux" [1318-1375] -->
125 <h2><a name=
"learning_to_use_git" id=
"learning_to_use_git">Learning to use git
</a></h2>
129 The toplevel documentation for git can be found at:
133 <a href=
"http://www.kernel.org/pub/software/scm/git/docs/" class=
"urlextern" title=
"http://www.kernel.org/pub/software/scm/git/docs/" rel=
"nofollow">Official git docs
</a>
137 The user’s manual for git can be found at:
141 <a href=
"http://www.kernel.org/pub/software/scm/git/docs/user-manual.html" class=
"urlextern" title=
"http://www.kernel.org/pub/software/scm/git/docs/user-manual.html" rel=
"nofollow">git user manual
</a>
145 A current tutorial can be found at:
149 <a href=
"http://www.kernel.org/pub/software/scm/git/docs/core-tutorial.html" class=
"urlextern" title=
"http://www.kernel.org/pub/software/scm/git/docs/core-tutorial.html" rel=
"nofollow">git core tutorial
</a>
153 Other nice tutorials/webpages:
157 <a href=
"http://wiki.sourcemage.org/Git_Guide" class=
"urlextern" title=
"http://wiki.sourcemage.org/Git_Guide" rel=
"nofollow">Git Guide
</a><br/>
158 <a href=
"http://wiki.sourcemage.org/Cogito_Guide" class=
"urlextern" title=
"http://wiki.sourcemage.org/Cogito_Guide" rel=
"nofollow">Cogito Guide
</a><br/>
159 <a href=
"http://git.or.cz/course/index.html" class=
"urlextern" title=
"http://git.or.cz/course/index.html" rel=
"nofollow">git Crash Courses
</a><br/>
160 <a href=
"http://git.or.cz/course/cvs.html" class=
"urlextern" title=
"http://git.or.cz/course/cvs.html" rel=
"nofollow">Cogito for CVS Users
</a><br/>
161 <a href=
"http://www.kernel.org/pub/software/scm/git/docs/tutorial.html" class=
"urlextern" title=
"http://www.kernel.org/pub/software/scm/git/docs/tutorial.html" rel=
"nofollow">Git for Everyone
</a><br/>
166 Keep in mind that some of these tutorials are a little dated and may not cover current git syntax.
170 <!-- SECTION "Learning to use git" [1376-2242] -->
171 <h2><a name=
"accessing_the_repository" id=
"accessing_the_repository">Accessing the repository
</a></h2>
175 To clone the gaf.git repository using anonymous git access:
177 <pre class=
"code">git clone git://git.gpleda.org/gaf.git
</pre>
180 For developer git access, you should contact Ales Hvezda to get an
<acronym title=
"Secure Shell">SSH
</acronym> public key installed and an account; having done so, the git
<acronym title=
"Uniform Resource Locator">URL
</acronym> to push to is:
182 <pre class=
"code">git clone ssh://
<username
>@git.gpleda.org/home/git/gaf.git
</pre>
185 If you have ssh access you will also need to edit your ~/.ssh/config file (create it if it doesn’t exist) and put the following text into it:
187 <pre class=
"code">Host git.gpleda.org
191 Finally, it is possible to access the repository using
<acronym title=
"Concurrent Versions System">CVS
</acronym>, as there is a git-cvsserver running. This is read-only access.
193 <pre class=
"code"> export CVSROOT=:pserver:anonymous@git.gpleda.org/home/git/gaf.git
197 You can only checkout exported heads (for example: master).
201 <!-- SECTION "Accessing the repository" [2243-3053] -->
202 <h2><a name=
"making_and_committing_changes" id=
"making_and_committing_changes">Making and committing changes
</a></h2>
206 <!-- SECTION "Making and committing changes" [3054-3098] -->
207 <h3><a name=
"setting_up_user_information" id=
"setting_up_user_information">Setting up user information
</a></h3>
211 You should make sure that your username
& e-mail address are set in your git configuration file.
213 <pre class=
"code">$ git config --global user.name
"Your Name Comes Here
"
214 $ git config --global user.email you@yourdomain.example.com
</pre>
217 <!-- SECTION "Setting up user information" [3099-3356] -->
218 <h3><a name=
"committing_patches_from_other_contributors" id=
"committing_patches_from_other_contributors">Committing patches from other contributors
</a></h3>
222 If you apply a patch from someone else (e.g. from a SourceForge patch record) there are a few things to consider. Git stores two different names and e-mail addresses for a given commit: the “author” of the patch, and the “committer” of the patch, so these details must be set correctly when making the commit.
226 First of all, check a few things:
229 <li class=
"level1"><div class=
"li"> You have the latest version of the patch.
</div>
231 <li class=
"level1"><div class=
"li"> The author of the patch is happy for it to be committed (and wasn’t still working on it)
</div>
233 <li class=
"level1"><div class=
"li"> That the you’re happy with the patch, and taking responsibility for committing those changes.
</div>
238 For simplicity, start from an unmodified up-to date tree (git status shows no changes).
242 Apply the patch as usual (as an example):
244 <pre class=
"code">$ patch -p1
< example_changes.patch
</pre>
247 If the patch needs any minor editing before it is committed (eg. white-space changes), please inform the author this was done. They may have other work based on their patch and will want to know if there were changes to the applied version.
251 Note:
<em>This is easy to miss accidentally if your editor introduces tabs. Please avoid letting it do so!
</em>
255 For every file changed, added or removed, you need to inform git before it will commit the changes. To see the modified files, run:
257 <pre class=
"code">$ git status
</pre>
260 For speed, the command:
262 <pre class=
"code">$ git add -u
</pre>
265 will update all files which git tracks, including any files which were deleted.
269 For adding any new files the patch introduced, use the command
271 <pre class=
"code">$ git add new_file.c
</pre>
274 Note: git add also takes wild-cards.
278 Commit the patch, making sure that the Author’s name and e-mail address are specified:
280 <pre class=
"code">$ git commit --author
"Author
's Name Comes Here
<author@example.com
>"</pre>
283 As an alternative, you can set the GIT_AUTHOR_NAME and GIT_AUTHOR_EMAIL environment variables before issuing the normal commit command
287 <!-- SECTION "Committing patches from other contributors" [3357-5208] -->
288 <h3><a name=
"writing_good_commit_messages" id=
"writing_good_commit_messages">Writing good commit messages
</a></h3>
292 The commit message format is as follows: a *strictly* one-line summary of the patch, followed by a blank line, followed by a long description. If you can fit the whole description of the patch on one line, that’s fine; don’t bother with the long description.
296 The one-line summary is used for generating e-mail subject lines, and for the gitk
& gitweb log displays. Having a good one-line summary is really useful, because it means those tools can be used to quickly find a commit of interest.
300 <strong>Do not
</strong> put a list of files changed into commit messages. This information can be trivially obtained using the git tools.
307 Added new GedaList class derived from GObject
309 This abstracts a GList with API for write access. Its main use is in list
310 change notification, as it emits a
"changed
" g_signal when modified.
311 Read only access to the underlying GList is provided by an accessor,
312 currenly implemented as a macro.
316 <!-- SECTION "Writing good commit messages" [5209-6190] -->
317 <h3><a name=
"push_is_destructive" id=
"push_is_destructive">Push is Destructive
</a></h3>
321 <strong>Warning: pushing changes to the remote repository is destructive
</strong>
325 Unlike
<acronym title=
"Concurrent Versions System">CVS
</acronym>, it is not the committing of changes which changes the master repository, but pushing changes using cg-push or git-push. You should always double- (or triple-) check that the commits you are about to push are actually meant for the main repository.
329 <!-- SECTION "Push is Destructive" [6191-6555] -->
330 <h2><a name=
"how_do_i" id=
"how_do_i">How Do I ... ?
</a></h2>
334 For a more information please checkout the
<a href=
"http://wiki.sourcemage.org/Git_Guide" class=
"urlextern" title=
"http://wiki.sourcemage.org/Git_Guide" rel=
"nofollow">Git Guide
</a>.
338 <!-- SECTION "How Do I ... ?" [6556-6679] -->
339 <h3><a name=
"get_a_copy_of_geda_gaf_git_repository" id=
"get_a_copy_of_geda_gaf_git_repository">... get a copy of gEDA/gaf git repository?
</a></h3>
343 For anonymous read-only access:
345 <pre class=
"code">$ git clone git://git.gpleda.org/gaf
</pre>
348 For developers with read/write access:
350 <pre class=
"code">$ git clone git://git.gpleda.org/home/git/gaf.git
</pre>
353 <!-- SECTION "... get a copy of gEDA/gaf git repository?" [6680-6899] -->
354 <h3><a name=
"keep_my_local_copy_current" id=
"keep_my_local_copy_current">... keep my local copy current?
</a></h3>
358 For those who are are not merging changes back into the central git repository you can run:
360 <pre class=
"code">$ git pull
</pre>
363 However, for those of you who are going to be pushing your changes back into the central git repository, using git pull will clutter up the history with merge messages (“Merge branch ‘master’”). To avoid this you should run:
365 <pre class=
"code">$ git fetch
366 $ git rebase origin
</pre>
369 <!-- SECTION "... keep my local copy current?" [6900-7314] -->
370 <h3><a name=
"commit_my_changes_to_the_local_git_repository" id=
"commit_my_changes_to_the_local_git_repository">... commit my changes to the local git repository?
</a></h3>
372 <pre class=
"code">$ git commit -a
</pre>
375 This command will find all changed files that git knows about (added with git-add) and prompt you for a commit message. Be sure to follow the above commit message convention if you plan on pushing your changes to the central repository.
379 If you want to commit files in the current directory or want to explicitly commit only certain files, do not specify the -a flag and/or specify the individual filenames on the command line like:
381 <pre class=
"code">$ git commit filename1 filename2
</pre>
384 <!-- SECTION "... commit my changes to the local git repository?" [7315-7868] -->
385 <h3><a name=
"undo_any_uncommitted_local_changes" id=
"undo_any_uncommitted_local_changes">... undo any uncommitted local changes?
</a></h3>
387 <pre class=
"code">$ git checkout -f
</pre>
390 Note this will discard any changes to any files that are being tracked by git.
394 <!-- SECTION "... undo any uncommitted local changes?" [7869-8022] -->
395 <h3><a name=
"fix_change_my_last_commit" id=
"fix_change_my_last_commit">... fix/change my last commit?
</a></h3>
397 <pre class=
"code">$ Edit whatever files
398 $ git commit --amend filename1..filenameN
</pre>
401 This will pickup any changes you made and recommit them again with the previous commit message.
405 <!-- SECTION "... fix/change my last commit?" [8023-] --></div>