Difference between revisions of "Activity Team/Git Tutorial"

From Sugar Labs
Jump to navigation Jump to search
Line 16: Line 16:
  
 
=== Create SSH Key ===
 
=== Create SSH Key ===
ToDo
+
To create a key use ssh-keygen. The following command will create an “dsa” key:
 +
 
 +
ssh-keygen -t dsa
 +
 
 +
 
 +
For creating a “rsa” key use:
 +
 
 +
ssh-keygen -t rsa
 +
 
 +
 
 +
The generated key will be stored in the hidden <tt>.ssh</tt> folder.
 +
<tt>id_dsa</tt> is your private key. Only you should have access to this private key.
 +
<tt>id_dsa.pub</tt> is your public key.
 +
 
 +
ls -al ~/.ssh
 +
-rw-------  1 strom strom  668 2009-12-17 21:51 id_dsa
 +
-rw-r--r--  1 strom strom  603 2009-12-17 21:51 id_dsa.pub
 +
 
 +
 
 +
Log in to http://git.sugarlabs.org/account and upload you public key. In your account you can find a link named <tt>Add SSH key</tt>. You can paste your public key directly to  the input field.
 +
 
 +
With ssh-keygen you can specify the name of your key file. Using this feature is no good idea. Keys should generally located in <tt>~/.ssh/id_rsa.pub</tt> or <tt>~/.ssh/id_dsa.pub</tt>.
 +
 
 +
ToDo: Does keys protected with a passphrase work together with GIT?
 +
 
 +
ToDo: What is the difference between DSA and RSA keys?
  
 
=== Create a Project ===  
 
=== Create a Project ===  

Revision as of 08:29, 21 December 2009

Team Home   ·   Join   ·   Contacts   ·   Resources   ·   FAQ   ·   Roadmap   ·   To Do   ·   Meetings

Gitorious

Getting started with Gitorious.

Create an account

Create an account on git.sugarlabs.org by selecting the register link on the home page.

Enter your

  • Login
  • Email
  • Password
  • Password confirmation

Follow link on email confirmation

Create SSH Key

To create a key use ssh-keygen. The following command will create an “dsa” key:

ssh-keygen -t dsa


For creating a “rsa” key use:

ssh-keygen -t rsa


The generated key will be stored in the hidden .ssh folder. id_dsa is your private key. Only you should have access to this private key. id_dsa.pub is your public key.

ls -al ~/.ssh
-rw-------   1 strom strom  668 2009-12-17 21:51 id_dsa
-rw-r--r--   1 strom strom  603 2009-12-17 21:51 id_dsa.pub


Log in to http://git.sugarlabs.org/account and upload you public key. In your account you can find a link named Add SSH key. You can paste your public key directly to the input field.

With ssh-keygen you can specify the name of your key file. Using this feature is no good idea. Keys should generally located in ~/.ssh/id_rsa.pub or ~/.ssh/id_dsa.pub.

ToDo: Does keys protected with a passphrase work together with GIT?

ToDo: What is the difference between DSA and RSA keys?

Create a Project

Created a new project by selecting the new link on the project page.

Enter your

  • Project Title
  • Project slug (This a filled in for you based on your project title
  • License
  • Description

There several other question which can be answered later as you have more information.

Create Local Repository

There are two way to create a local repository. Initial one from scratch using git commands or pull your new project from Gitorious.

Initialize blank repository

Make a directory for your project, and copy your source files there. Change to the project directory and run:

git init

Pull from Gitorious

One of the easiest way to create a local git repository which it set up to point to your new Gitorious project is to

Push project

git remote add origin gitorious@git.sugarlabs.org:turtleart/mainline.git
# to push the master branch to the origin remote we added above:
git push origin master 
# after that you can just do:
git push

To find the push URL, visit the Gitorious page for the project. Example: http://git.sugarlabs.org/projects/turtleart/repos/mainline

Use

git-pull

to periodically pull pootle updates to the project .po files (every Friday?)

Also, run

python setup.py fix_manifest

to update the .mo files after updating the .po files


alsroot taught me about another git feature: tags

git tag -m "Release 36" v36 HEAD
git push --tags

bertf explained to me that git-pull does a combination of fetch and merge, so to merge a patch...

git pull git://git.sugarlabs.org/infoslicer/alsroots-clone.git master


A few notes re moving to the Sugar Labs infrastructure:

  • use git init to create a new project
  • source packages now go in

shell.sugarlabs.org:/upload/sources/sucrose/fructose/

download.sugarlabs.org:/var/www-sugarlabs/download/sources/sucrose/fructose/
  • don't forget to update addons as well!!
  • and to copy the tar file to download.sugarlabs.org
download.sugarlabs.org:/download/sources/honey/...
download.sugarlabs.org:/download/sources/sucrose/fructose/...