Importing your project

From OLPC

Revision as of 13:57, 18 March 2008 by Openspark (Talk | contribs)
(diff) ← Older revision | Current revision (diff) | Newer revision → (diff)
Jump to: navigation, search
  This page is monitored by the OLPC team.

Contents

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. You may have to fill out a successful application to get started.


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.

Step 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.

In Ubuntu 7/Feisty and Debian Etch (and presumably earlier) "git" still refers to gitfm, an unrelated tool. To fix in feisty:
sudo apt-get install git-core cogito 
sudo update-alternatives --config git

Step 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

Tell git who you are:

$ git config user.name "FirstName LastName"
$ git 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'

Step 3. Pointing the tree at the OLPC server

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

Having submitted a project hosting request, you will have received a project path in the body of the email message approving your request. Please use that path as your URL as you follow the instructions below:

Run one of the following two commands, depending on whether you requested a

Central Tree:

$ git remote add origin git+ssh://MYUSER@dev.laptop.org/git/projects/MYTREE

Personal Tree:

$ git remote add origin git+ssh://MYUSER@dev.laptop.org/git/users/MYUSER/MYTREE

Obviously, replace MYUSER and MYPROJECT with the project name and username you received.

Step 4. Performing the initial push

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

$ git push --all

If this "git push --all" fails:

  • Ensure that your private SSH key (root/.ssh/id_dsa) has permissions set to only be readable by your user name, then try "git push --all" again.
  • Save your source tree and perform a "git pull" the tree should be intact, but restore any files that may be missing or modified.

Step 5. Subsequent pushes

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

Get the status of how a commit will go:

$ git status

use "git add", git rm and or "git rm -rf" to adjust what will be checked in. If you have not added or removed any files you don't have to use git add, you may just use commit -a, this will commit all the modified files already in the git tree.

$ git commit <-a>

this will bring up an editor where you enter comments about what is going on. Note that the first line of this file will become the tag at the top of your tree

$ 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.

Step 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.

See also

Personal tools
  • Log in
  • Login with OpenID
About OLPC
About the laptop
About the tablet
Projects
OLPC wiki
Toolbox