Importing your project: Difference between revisions

From OLPC
Jump to navigation Jump to search
Line 40: Line 40:
You now need to tell git that your pushes go to the OLPC system.
You now need to tell git that your pushes go to the OLPC system.


Insert these two lines into .git/refs/remotes/origin within your newly-versioned project tree:
Insert these two lines into .git/remotes/origin within your newly-versioned project tree (create the file if it doesn't exist):


<pre>
<pre>

Revision as of 18:47, 19 June 2007

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.

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-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'

Step 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 (create the file if it doesn't exist):

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

Step 4. Performing the initial push

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

$ git push --all

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

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.