Kuku/Git Usage: Difference between revisions

From OLPC
Jump to navigation Jump to search
No edit summary
Line 40: Line 40:
git checkout master
git checkout master
git push . local_branch_name
git push . local_branch_name

===Pushing to Remote Branches===


== Useful Links ==
== Useful Links ==

Revision as of 21:10, 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

Useful Links

Git Tutorial Part 1

Git for CVS Users

SourceMage Git Guide