<html>
<head>
<base href="https://wiki.asterisk.org/wiki">
<link rel="stylesheet" href="/wiki/s/2033/1/7/_/styles/combined.css?spaceKey=TOP&forWysiwyg=true" type="text/css">
</head>
<body style="background: white;" bgcolor="white" class="email-body">
<div id="pageContent">
<div id="notificationFormat">
<div class="wiki-content">
<div class="email">
<h2><a href="https://wiki.asterisk.org/wiki/display/TOP/Source+Repository">Source Repository</a></h2>
<h4>Page <b>edited</b> by <a href="https://wiki.asterisk.org/wiki/display/~dlee">David M. Lee</a>
</h4>
<br/>
<h4>Changes (5)</h4>
<div id="page-diffs">
<table class="diff" cellpadding="0" cellspacing="0">
<tr><td class="diff-snipped" >...<br></td></tr>
<tr><td class="diff-unchanged" >h3. Access to the server <br> <br></td></tr>
<tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">The server uses [gitolite|http://github.com/sitaramc/gitolite] for authentication and authorization control. Access to the server is over SSH, using key-based authentication only; git commands can be told to connect to {{git@git.asterisk.org}} to access the repositories. <br></td></tr>
<tr><td class="diff-added-lines" style="background-color: #dfd;">The server uses [gitolite|http://github.com/sitaramc/gitolite] for authentication and authorization control. Anonymous read access is over the Git protocol; git commands can be told to connect to {{git://git.asterisk.org/}} to access repositories. A full list of repositories is available via the [gitweb|http://git.asterisk.org/gitweb/] interface. <br></td></tr>
<tr><td class="diff-unchanged" > <br></td></tr>
<tr><td class="diff-added-lines" style="background-color: #dfd;">h4. Read/write access to the server <br> <br>Write access to the server is over SSH, using key-based authentication only; git commands can be told to connect to {{git@git.asterisk.org}} to access the repositories. <br> <br></td></tr>
<tr><td class="diff-unchanged" >If you don't already have an SSH key pair, or you wish to create one specifically for this purpose, can you use the following command: <br> <br></td></tr>
<tr><td class="diff-snipped" >...<br></td></tr>
<tr><td class="diff-unchanged" > <br>{code:bash} <br></td></tr>
<tr><td class="diff-changed-lines" >$ git clone <span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">git@git.asterisk.org:asterisk-scf/release/ice</span> <span class="diff-added-words"style="background-color: #dfd;">git://git.asterisk.org/asterisk-scf/release/ice</span> my-ice-repo <br></td></tr>
<tr><td class="diff-unchanged" >{code} <br> <br></td></tr>
<tr><td class="diff-added-lines" style="background-color: #dfd;">{info} <br>If you also need write access to repositories, you can run the following command. This allows you to clone the Git URL, and have pushes automagically redirected to the SSH URL. <br>{code:bash} <br>git config --global url.git@git.asterisk.org:.pushinsteadof git://git.asterisk.org/ <br>{code} <br>{info} <br> <br></td></tr>
<tr><td class="diff-unchanged" >This will create a local Git repository in a directory called 'my-ice-repo' under the current directory, with the 'master' branch already checked out into the working tree. In addition, it will define a Git remote called 'origin' that points back to the source repository, and will create refs to track all the branches that exist in the source repository. It will *not* make local branches that correspond to the branches in the source repository; if you want those, you'll have to create them yourself (see Branching below). If the source repository has links to submodules (see Submodules below), you can add the {{--recursive}} argument to the clone operation to automatically initialize and clone the submodules as well (and any submodules they use, and so on). <br> <br></td></tr>
<tr><td class="diff-snipped" >...<br></td></tr>
</table>
</div> <h4>Full Content</h4>
<div class="notificationGreySide">
<p>Project source code is stored in a collection of Git repositories located on the git.asterisk.org server. Access to these repositories is available only to those who have provided an SSH public key to the system administrators and have been given permission to view and/or change the repositories. An online source code repository browser is available at <tt><a href="https://code.asterisk.org" class="external-link" rel="nofollow">https://code.asterisk.org</a></tt></p>
<h3><a name="SourceRepository-Accesstotheserver"></a>Access to the server</h3>
<p>The server uses <a href="http://github.com/sitaramc/gitolite" class="external-link" rel="nofollow">gitolite</a> for authentication and authorization control. Anonymous read access is over the Git protocol; git commands can be told to connect to <tt>git://git.asterisk.org/</tt> to access repositories. A full list of repositories is available via the <a href="http://git.asterisk.org/gitweb/" class="external-link" rel="nofollow">gitweb</a> interface.</p>
<h4><a name="SourceRepository-Read%2Fwriteaccesstotheserver"></a>Read/write access to the server</h4>
<p>Write access to the server is over SSH, using key-based authentication only; git commands can be told to connect to <tt>git@git.asterisk.org</tt> to access the repositories.</p>
<p>If you don't already have an SSH key pair, or you wish to create one specifically for this purpose, can you use the following command:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<script type="syntaxhighlighter" class="toolbar: false; theme: Confluence; brush: bash; gutter: false"><![CDATA[
$ ssh-keygen [ -f asterisk_scf_key ]
]]></script>
</div></div>
<p>Without the -f option, ssh-keygen will create "id_rsa" and "id_rsa.pub" files in the .ssh subdirectory of your home directory; with the -f option, it will create files in the current directory (or the directory you specify, if include a path). In either case, the ".pub" file is the one that must be sent to the Git server administrators to enable access to the repositories. If you want, you can create keys on multiple systems and send all of them; they will all be mapped to a single user account on the Git server.</p>
<p>By default ssh-keygen will prompt you for a passphrase to be used to encrypt the private key file it creates; with most versions of ssh-keygen, you can just enter an empty passphrase to leave the private key file unencrypted. If you choose to do this, you must keep the private key file extremely secure, because anyone who obtains a copy of it can impersonate you and will have access to all the resources that you do. If you put a passphrase on your private key (which is highly recommended), the ssh-agent program can be used to 'remember' your private key's passphrase throughout the lifetime of a login session, without recording it on disk. </p>
<h3><a name="SourceRepository-Organization"></a>Organization</h3>
<ul>
        <li>Repository: <tt><b>asterisk-scf/integration/gitall</b></tt> - Integrated build. Follow the README.
        <ul>
                <li>This clones the git repos for several other components and adjusts them for an integrated build. To help with managing multiple git repos at once, see the attached <tt>git-for-each.sh</tt> script. This script will run the given command on the current directory, and all subdirectories that are git repos.</li>
        </ul>
        </li>
</ul>
<ul>
        <li>Repository: <tt><b>asterisk-scf/integration/bridging</b></tt></li>
</ul>
<ul>
        <li>Repository: <tt><b>asterisk-scf/integration/routing</b></tt></li>
</ul>
<ul>
        <li>Repository: <tt><b>asterisk-scf/integration/servicediscovery</b></tt></li>
</ul>
<ul>
        <li>Repository: <tt><b>asterisk-scf/integration/sip</b></tt></li>
</ul>
<ul>
        <li>Repository: <tt><b>asterisk-scf/integration/media_rtp_pjmedia</b></tt></li>
</ul>
<ul>
        <li>Repository: <tt><b>asterisk-scf/integration/slice</b></tt></li>
</ul>
<ul>
        <li>Repository: <tt><b>asterisk-scf/integration/media_format_ulaw</b></tt></li>
</ul>
<ul>
        <li>Repository: <tt><b>asterisk-scf/release/ice</b></tt> - Ice source code
        <ul>
                <li>Branch: master - current version of Ice to be used for Asterisk SCF, including modifications</li>
                <li>Branch: upstream - latest version of Ice from ZeroC imported into the repository</li>
                <li>Branch: add-toplevel-test-target - corrects an oversight in the top-level Makefile.mak for Windows</li>
                <li>Branch: cpp-default-runpath-symlink - changes default for Linux installations to ensure that installations of newer versions are accessible using only the major/minor release version string</li>
                <li>Branch: generate-pragma-once - changes Slice translator for C++ to use <tt>#pragma once</tt> in generated header files instead of traditional include guards</li>
                <li>Branch: icebox-local-services - adds Local Services directory to IceBox for C++, C# and Java</li>
                <li>Branch: ignore-generated-files - adds .gitignore files in all places necessary in the tree for git to be able to ignore files generated by building Ice</li>
                <li>Branch: java-disable-jgoodies-windows - disables the IceGrid GUI admin tool from supporting the JGoodies 'Windows' look-and-feel, since this is not widely distributed and there is a sensible default when it is not found</li>
                <li>Branch: java-windows-auto-db-path - adds a default path to the Berkeley DB JAR file on Windows, so that building the Ice mapping for Java on Windows will work with only minor modifications when the Ice third-party dependencies package from ZeroC is installed</li>
                <li>Branch: java-windows-auto-path - detects OS and sets paths appropriately. Avoids need to modify <tt>build.properties</tt> for Windows builds.</li>
                <li>Branch: preserve-graphs - adds support for 'unsliceable' classes, that can be transferred over Ice, and through servants, without being sliced and losing derived class data</li>
                <li>Branch: slice2java-classes - adds command-line option to the Slice translator for Java to emit the names of the class files it will generate when it is run</li>
                <li>Branch: slice-translator-versioning - adds support for masking portions of the Slice namespace, to be used to support simplified API versioning model</li>
                <li>Branch: use-pragma-once - modifies Slice files provided with Ice to use <tt>#pragma once</tt> instead of traditional include guards</li>
        </ul>
        </li>
</ul>
<ul>
        <li>Repository: <tt><b>asterisk-scf/release/techdemo</b></tt> - Milestone 1 (technology demonstration) components and prototypes
        <ul>
                <li>Branch: master - primary development branch</li>
        </ul>
        </li>
</ul>
<ul>
        <li>Repository: <tt><b>asterisk-scf/release/cmake</b></tt> - Asterisk SCF CMake build scripts
        <ul>
                <li>Branch: master - primary development branch</li>
        </ul>
        </li>
</ul>
<ul>
        <li>Repository: <tt><b>asterisk-scf/release/design</b></tt> - Asterisk SCF design models
        <ul>
                <li>Branch: master - primary development branch</li>
        </ul>
        </li>
</ul>
<ul>
        <li>Directory: <tt><b>team/<em>CREATOR</em></b></tt> - Asterisk SCF developer repository area<br/>
Each developer can place repositories in their subdirectory (named the same as their SSH key's name), and they will be accessible (read-only) to anyone who has access to the server. In addition, developers can place repositories in a 'private' subdirectory of their team directory, and these repositories will only be visible to them and the system administrators.</li>
</ul>
<ul>
        <li>Repository: <tt><b>gitolite</b></tt> - source code for gitolite, and common hook scripts used in repositories on server
        <ul>
                <li>Branch: master - current version of gitolite installed on the server, including modifications</li>
                <li>Branch: allow-setdesc-for-creators - changes <tt>setdesc</tt>, <tt>setperms</tt>, <tt>getdesc</tt>, and <tt>getperms</tt> commands to use the <tt>C</tt> permission on the target repository for authorization, rather than requiring the issuer of the command to be the repository's owner</li>
                <li>Branch: wildcard-repo-config-keys - preliminary support allowing config keys to be used with wildcard repository patterns in the gitolite configuration file</li>
        </ul>
        </li>
</ul>
<ul>
        <li>Repository: <tt><b>gitolite-admin</b></tt> - configuration files for gitolite
        <ul>
                <li>Branch: master - current version of configuration files</li>
        </ul>
        </li>
</ul>
<h3><a name="SourceRepository-Cloning%2CPushingandPulling"></a>Cloning, Pushing and Pulling</h3>
<p>Basic operations using these repositories are quite simple, and should be obvious to anyone who uses Git. Cloning a repository (for example, the asterisk-scf/release/ice repository) is as simple as:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<script type="syntaxhighlighter" class="toolbar: false; theme: Confluence; brush: bash; gutter: false"><![CDATA[
$ git clone git://git.asterisk.org/asterisk-scf/release/ice my-ice-repo
]]></script>
</div></div>
<div class='panelMacro'><table class='infoMacro'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="/wiki/images/icons/emoticons/information.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td>If you also need write access to repositories, you can run the following command. This allows you to clone the Git URL, and have pushes automagically redirected to the SSH URL.
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<script type="syntaxhighlighter" class="toolbar: false; theme: Confluence; brush: bash; gutter: false"><![CDATA[
git config --global url.git@git.asterisk.org:.pushinsteadof git://git.asterisk.org/
]]></script>
</div></div></td></tr></table></div>
<p>This will create a local Git repository in a directory called 'my-ice-repo' under the current directory, with the 'master' branch already checked out into the working tree. In addition, it will define a Git remote called 'origin' that points back to the source repository, and will create refs to track all the branches that exist in the source repository. It will <b>not</b> make local branches that correspond to the branches in the source repository; if you want those, you'll have to create them yourself (see Branching below). If the source repository has links to submodules (see Submodules below), you can add the <tt>--recursive</tt> argument to the clone operation to automatically initialize and clone the submodules as well (and any submodules they use, and so on).</p>
<p>Some time later, when the source repository has had additional changes made that don't yet appear in your clone of it, you can get those changes by executing (in some directory inside the clone):</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<script type="syntaxhighlighter" class="toolbar: false; theme: Confluence; brush: java; gutter: false"><![CDATA[
$ git pull
]]></script>
</div></div>
<p>This will fetch all commits from the source repository that are required to bring your clone's copies of the refs up to date, including those required for new refs (branches, tags, and any others), and then fetch the new refs themselves. Note that this cannot be done if the working tree contains uncommitted changes; if you have changes you haven't committed yet, you'll either need to commit them or stash them (using 'git stash') before pulling updates from the source repository.</p>
<p>This command will update <b>all</b> refs in your clone; if you only want to update a specific ref (say, a single branch), you can do so by specifying the branch name as an additional argument to the 'pull' command. Note that this latter method of operation will also merge the fetched changes into the <b>current</b> branch you have checked out, so be careful.</p>
<p>Finally, when you have changes you'd like to push up to the source repository (and you have permissions to do so), you can push your changes by executing (in some directory inside the clone):</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<script type="syntaxhighlighter" class="toolbar: false; theme: Confluence; brush: java; gutter: false"><![CDATA[
$ git push
]]></script>
</div></div>
<p>This command will push all commits required to bring the source repository's copy of the ref your <b>current</b> branch points to up to date, and then update the ref on the source repository to point to the same HEAD as your current branch. If the source repository is ahead of your clone (contains additional commits on the current branch), then you'll have to use 'git pull' first to bring down those commits, possibly dealing with any merge conflicts, before you can push your changes to the source repository.</p>
<p>If you have changes in multiple branches you wish to push, you can use <tt>git push --all</tt>, which will perform the same operation detailed above, but for all of your local branches. If you have created, removed or otherwise modified tag objects, you will need to use <tt>git push --tags</tt> for those tag changes to be pushed to the source repository; this can be combined with <tt>--all</tt> to essentially bring the source repository completely up to date with the changes you have made in your clone.</p>
<h3><a name="SourceRepository-BranchingandBranchPolicies"></a>Branching and Branch Policies</h3>
<h3><a name="SourceRepository-Submodules"></a>Submodules</h3>
<h3><a name="SourceRepository-Developer%28%27team%27%29Repositories"></a>Developer ('team') Repositories</h3>
<p>Create a team repository by just cloning it. It will be automatically created and an empty repository will be returned to you.</p>
<div class='panelMacro'><table class='noteMacro'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="/wiki/images/icons/emoticons/warning.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td>There are likely to be changes to the server at some point that require a different command to explicitly create the repository first, instead of having it implicitly created as a result of the clone request.</td></tr></table></div>
<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent">
<pre>$ git clone git@git.asterisk.org:team/<developer>/foo
</pre>
</div></div>
<p>Next, populate the local <tt>master</tt> branch with content.</p>
<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent">
<pre>$ cd foo
$ echo "hello world" > hello.txt
$ git add hello.txt
$ git commit -m "Add hello.txt"
</pre>
</div></div>
<p>Push changes up to the remote repository.</p>
<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent">
<pre>$ git push origin master
</pre>
</div></div>
<p>Now that <tt>master</tt> exists in the remote repository, further commits can be pushed by simply using <tt>$ git push</tt>.</p>
<h3><a name="SourceRepository-gitolitecommands"></a>gitolite commands</h3>
</div>
<div id="commentsSection" class="wiki-content pageSection">
<div style="float: right;">
<a href="https://wiki.asterisk.org/wiki/users/viewnotifications.action" class="grey">Change Notification Preferences</a>
</div>
<a href="https://wiki.asterisk.org/wiki/display/TOP/Source+Repository">View Online</a>
|
<a href="https://wiki.asterisk.org/wiki/pages/diffpagesbyversion.action?pageId=131094&revisedVersion=30&originalVersion=29">View Changes</a>
|
<a href="https://wiki.asterisk.org/wiki/display/TOP/Source+Repository?showComments=true&showCommentArea=true#addcomment">Add Comment</a>
</div>
</div>
</div>
</div>
</div>
</body>
</html>