Kuku/Git Usage: Difference between revisions

From OLPC
Jump to navigation Jump to search
Line 16: Line 16:


===Working with Remote Branches===
===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


===Pushing to Remote Branches===
===Pushing to Remote Branches===

Revision as of 21:09, 11 July 2007

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.

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

Pushing to Remote Branches

Useful Links

Git Tutorial Part 1

Git for CVS Users

SourceMage Git Guide