# How to Add a git Repository to Virgo

While this information is mainly of use while the Virgo repositories are initially being populated, it may be useful later. It says how to trace back from Virgo to its origins, how to update a repository description, and what files to copy when a new repository is added.

1. Add the new repository to the git server (may require project lead privileges):

    &gt;ssh &lt;committer_id&gt;@git.eclipse.org
    &gt;initrepo /gitroot/virgo/org.eclipse.virgo.&lt;reponame&gt;.git
    &lt;log out e.g. using Ctrl-D&gt;

2. Clone the new repository:

    &gt;git clone ssh://&lt;committer_id&gt;@git.eclipse.org/gitroot/virgo/org.eclipse.virgo.&lt;reponame&gt;.git &lt;repo dir&gt;

3. Create the directories of the new repository and any <tt>.gitignore</tt> file. For example:

    &gt;cd &lt;repo dir&gt;
    &gt;cp &lt;source dir&gt;/.gitignore .
    &gt;cp -r &lt;source dir&gt;/o* .
    &gt;cp -r &lt;source dir&gt;/b* .

Make sure you get all the files -- some of them may not fall into these patterns. 4. If you are creating the new repository from an existing git repository, tag the existing repository and make a note of the tagged commit SHA.

    &gt;cd &lt;source dir&gt;
    &gt;git tag Virgo-checkin
    &gt;git push origin master --tags
    &gt;cd &lt;repo dir&gt;

5. Add a submodule for Virgo build.

    &gt;git submodule add git://git.eclipse.org/gitroot/virgo/org.eclipse.virgo.virgo-build.git virgo-build

6. Stage all the above changes and push to master.

    &gt;git add .
    &gt;git commit -m "initial checkin from &lt;existing repository&gt; commit &lt;tagged commit SHA&gt;"
    &gt;git push origin master

7. Edit .git/description, making sure the file is a single line ending in a newline, and rsynch this (may require project lead privileges).

    &gt;rsync .git/description &lt;committer-id&gt;@git.eclipse.org:/gitroot/virgo/org.eclipse.virgo.&lt;reponame&gt;.git/description

8. Add the new repository to the table above.

9. Use the Foundation Portal to add the new repository to the list of source repositories in the project metadata. In particular, this should cause the repository to be mirrored on github.

10. Don't forget to create Hudson build jobs, if you need them, and close any bug which was tracking the creation of the new repository.