Importing your project: Difference between revisions

From OLPC
Jump to navigation Jump to search
m (..)
(braces --> pre)
Line 13: Line 13:
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:
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:


<pre>
{{{
$ cd MYPROJECT
$ cd MYPROJECT
$ git init-db
$ git init-db
</pre>
}}}


Tell git who you are:
Tell git who you are:


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


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


<pre>
{{{
$ git add .
$ git add .
$ git commit -a -m 'Initial import'
$ git commit -a -m 'Initial import'
</pre>
}}}


=== 3. Pointing the tree at the OLPC server ===
=== 3. Pointing the tree at the OLPC server ===
Line 38: Line 38:
Insert these two lines into .git/remotes/origin within your newly-versioned project tree:
Insert these two lines into .git/remotes/origin within your newly-versioned project tree:


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


Obviously, replace MYPROJECT with the project name you requested.
Obviously, replace MYPROJECT with the project name you requested.
Line 47: Line 47:
If you're pushing a personal tree, use the line:
If you're pushing a personal tree, use the line:


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


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


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


=== 4. Performing the initial push ===
=== 4. Performing the initial push ===
To do the initial push of your project to the OLPC server, run:
To do the initial push of your project to the OLPC server, run:


<pre>
{{{
$ git push --all
$ git push --all
</pre>
}}}


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


<pre>
{{{
$ git push
$ git push
</pre>
}}}


Will do the trick.
Will do the trick.
Line 77: Line 77:
=== 6. Checking out your tree ===
=== 6. Checking out your tree ===
To verify that everything works, attempt to clone your tree from the OLPC server within your /tmp directory:
To verify that everything works, attempt to clone your tree from the OLPC server within your /tmp directory:
<pre>
{{{
$ cd /tmp
$ cd /tmp
$ git clone git://dev.laptop.org/projects/MYPROJECT
$ git clone git://dev.laptop.org/projects/MYPROJECT
$ ls MYPROJECT
$ ls MYPROJECT
</pre>
}}}


That's it! Enjoy.
That's it! Enjoy.

Revision as of 02:54, 10 April 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.

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.