Importing your project

From OLPC
Revision as of 18:19, 31 March 2007 by Sj (talk | contribs) (+import from http://dev.laptop.org/wiki/ImportingYourProject)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

If you have a project you want us to host for you, including a source repository (and potentially any related webpages), this page is for you.

Importing your project into your OLPC-hosted repository

At this time, we don't have the means to let developers create their own trees on the OLPC servers, so the following assumes you're using a central/shared tree for the project.

If you're using the one maintainer model, please ask us to create any other trees you need. We're working on adding the functionality to git-shell that will let you do this without our intervention in the future.

1. Install git

First, you'll need to fetch and install git on your machine. The tarball with the latest version is always available at the git site, and you might find your distribution provides packages. You can expect that the OLPC servers will always be running close to the latest version of the git tools.

2. Version your project locally

If your project is already in a local git tree, you may skip this step. Otherwise, change into your project directory and initialize the tree:

{{{ $ cd MYPROJECT $ git init-db }}}

Tell git who you are:

{{{ $ git repo-config user.name "FirstName LastName" $ git repo-config user.email "user@example.com" }}}

Add your project files to git, and commit the initial tree:

{{{ $ git add . $ git commit -a -m 'Initial import' }}}

3. Pointing the tree at the OLPC server

You now need to tell git that your pushes go to the OLPC system.

Insert these two lines into .git/remotes/origin within your newly-versioned project tree:

{{{ URL: git+ssh://dev.laptop.org/git/projects/MYPROJECT Pull: refs/heads/master:refs/heads/origin }}}

Obviously, replace MYPROJECT with the project name you requested.

If you're pushing a personal tree, use the line:

{{{ URL: git+ssh://dev.laptop.org/~/public_git/MYTREE }}}

for the URL: line. If the user on your local machine and the dev.laptop.org server is different, make sure to modify the above lines for your dev.laptop.org user. I.E.:

{{{ URL: git+ssh://MYUSER@dev.laptop.org/git/projects/MYPROJECT }}}

4. Performing the initial push

To do the initial push of your project to the OLPC server, run:

{{{ $ git push --all }}}

5. Subsequent pushes

For subsequent pushes, you don't generally need to use the --all parameter anymore, so

{{{ $ git push }}}

Will do the trick.

Note: Omitting --all will update all branches that are already present on the OLPC server. If you add new branches you will need to use --all again.

6. Checking out your tree

To verify that everything works, attempt to clone your tree from the OLPC server within your /tmp directory: {{{ $ cd /tmp $ git clone git://dev.laptop.org/projects/MYPROJECT $ ls MYPROJECT }}}

That's it! Enjoy.