Importing your project: Difference between revisions

From OLPC
Jump to navigation Jump to search
(→‎Step 1. Install git: git confusion)
Line 44: Line 44:
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.


'''Having submitted a [[Project_hosting_application|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:'''
Insert these two lines into .git/remotes/origin within your newly-versioned project tree ('''create the file (and directory) if it doesn't exist'''):

Insert these two lines into .git/remotes/origin within your newly-versioned project tree. (You should create the <tt>remotes</tt> directory and <tt>origin</tt> file if they doesn't already exist.)


<pre>
<pre>
Line 51: Line 53:
</pre>
</pre>


Obviously, replace MYPROJECT with the project name you requested.
Obviously, replace MYPROJECT with the project name you requested


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

Revision as of 20:54, 2 November 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.

In Ubuntu 7/Feisty (and presumably earlier) "git" still refers to gitfm, an unrelated tool. To fix in feisty:
 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-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.

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:

Insert these two lines into .git/remotes/origin within your newly-versioned project tree. (You should create the remotes directory and origin file if they doesn't already 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.

See also