Kuku/Git Usage

From OLPC
< Kuku
Revision as of 21:35, 14 July 2007 by Lucks (talk | contribs) (Useful Links: linus torvalds on git)
Jump to: navigation, search

This page describes how the kuku project uses git to manage the source code. Here you will find useful git commands for playing with the kuku code, as well as a description of what each branch means in terms of kuku development.

Kuku Branch Structure

The most up to date list of branches can be seen on our trac page. For now, we only have one branch called 'master'. It is important to note that sugar-jhbuild pulls from the master branch by default.

Git commands for working with Kuku

Importing the Code

git clone git://dev.laptop.org/projects/kuku

Adding a Remote Branch

First create a local branch from the current master branch

git branch Trial-2

Now checkout that branch you just created

git checkout Trial-2

After adding/editing/commiting this branch, push it to the remote master

git push origin Trail-2:Trial-2

Working with Remote Branches

See the remote branches with

git branch -r

Or see local branches with

git branch

Or see all branches with

git branch -a

For each remote branch you want to work on, create a local branch

git branch --track <local name> <remote name>
git branch --track Trial-2 origin/Trial-2

Checkout your new branch

git checkout Trial-2

add/edit/commit, then push your changes upstream (while you are still in this branch) with

git push

Working with Local Branches

This is usefel to test out an idea locally without adding a branch to the remote master repo. Make a local branch with

git branch local_branch_name

See that it is there with

git branch

Switch to that branch

git checkout local_branch_name

add/edit/commit. You can merge this branch with the master branch with

git checkout master
git push . local_branch_name

Once you have committed changes to a local branch, you can remove it with

git branch -d local_branch_name

Or if you don't want to commit, but juts wipe it out, use

git branch -D local_branch_name

Useful Links

Git Tutorial Part 1

Git for CVS Users

SourceMage Git Guide

Linus Torvalds on Git - Google Talks - You Tube