Importing your project: Difference between revisions

From OLPC
Jump to navigation Jump to search
(..)
No edit summary
 
(30 intermediate revisions by 16 users not shown)
Line 1: Line 1:
{{OLPC}}
If you have a project you want us to [[Project hosting|host]] for you, including a source repository (and potentially any related webpages), this page is for you. You may have to fill out a [[Project hosting application|application]] to get started.
{{TOCright}}


If you had a project you wanted us to [[Project hosting|host]] for you, including a source repository (and potentially any related webpages), this page was for you. You will have filled out a successful [[Project hosting application|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.

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.
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 ===
== 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 [http://git.or.cz 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.


Install Git on your machine. See [[Git#Installation]] for details.
=== 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:


== Identify yourself ==
{{{
$ cd MYPROJECT
$ git init-db
}}}


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


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

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

<pre>
$ cd MYPROJECT
$ git init
</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 ===
== Pointing the tree at the OLPC server ==


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:


Run one of the following two commands, depending on whether you requested a
{{{
URL: git+ssh://dev.laptop.org/git/projects/MYPROJECT
Pull: refs/heads/master:refs/heads/origin
}}}


'''Central Tree''':
Obviously, replace MYPROJECT with the project name you requested.
<pre>
$ git remote add origin git+ssh://MYUSER@dev.laptop.org/git/projects/MYTREE
</pre>


'''Personal Tree''':
If you're pushing a personal tree, use the line:
<pre>
$ git remote add origin git+ssh://MYUSER@dev.laptop.org/git/users/MYUSER/MYTREE
</pre>


Obviously, replace MYUSER and MYPROJECT with the project name and username you received.
{{{
URL: git+ssh://dev.laptop.org/~/public_git/MYTREE
}}}


== Performing the initial push ==
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:
To do the initial push of your project to the OLPC server, run:


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

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.

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


Get the status of how a commit will go:
{{{

<pre>
$ git status
</pre>

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.

<pre>
$ git commit <-a>
</pre>

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

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


Will do the trick.
Will do the trick.
Line 75: Line 99:
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.
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 ===
== 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.

== See also ==

{{:Git/See also}}

[[Category:Software development]]
[[Category:Software]]
[[Category:Developers]]
[[Category:HowTo]]
[[Category:Git]]

Latest revision as of 05:50, 2 July 2014

  This page is monitored by the OLPC team.

If you had a project you wanted us to host for you, including a source repository (and potentially any related webpages), this page was for you. You will have filled out a successful application to get started.


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.

Install git

Install Git on your machine. See Git#Installation for details.

Identify yourself

Tell git who you are:

$ git config user.name "FirstName LastName"
$ git config user.email "user@example.com"

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

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

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

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.

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.

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.

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