Git: Difference between revisions

From OLPC
Jump to navigation Jump to search
(→‎Git Commands: Another example)
(Add link)
Line 62: Line 62:
== Further Resources ==
== Further Resources ==


* [http://git.or.cz/ git] home page
* [http://git.or.cz/#download Download git-core] or
* [http://git.or.cz/#download Download git-core] or
* Read more about git [http://en.wikipedia.org/wiki/Git_(software) on Wikipedia]

* [http://en.wikipedia.org/wiki/Git_(software) Read more about git on Wikipedia]
* [http://freedesktop.org/wiki/UsingGit Freedesktop Git]
* [http://freedesktop.org/wiki/UsingGit Freedesktop Git]
* [[Using a central git tree]]
* [[Using a central git tree]]

Revision as of 02:48, 20 March 2008


Pencil.png NOTE: The contents of this page are not set in stone, and are subject to change!

This page is a draft in active flux ...
Please leave suggestions on the talk page.

Pencil.png
This command is run in the standard Linux environment via the Terminal Activity. The GUI will probably not integrate comfortably with the XO Laptop's Sugar environment. Your user experience may vary considerably depending on the established environment and the other programs running on the laptop, may need re-installation after an OS Update. See the Linux software category for other commands.


Description

Git is a version control ("revision control") system for programmers used to track and manage changes to code. It happens to be a decentralized system, with no "master" tree, and was originally written by Linus Torvalds to manage the Linux kernel sources.

Installation

First, you'll need to fetch and install Git on your machine. The tarball with the latest version is always available at the 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.

In OpenSuSE
yast --install git
In RedHat & XO Laptop
sudo yum install git
In Ubuntu 7/Feisty and Debian Etch (and presumably earlier) "git" still refers to gitfm, an unrelated tool. To fix in feisty:
sudo apt-get install git-core cogito 
sudo update-alternatives --config git

Running

Git Commands

To get a project's code for the first time, use "git clone" :

git-clone git://dev.laptop.org/<project-directory> (To get the code)

For instance:

git-clone git://dev.laptop.org/activities/epals 
    OR 
git clone git://dev.laptop.org/activities/epals 

You can update the code as follows:

git-pull (To update the code)
git-status -a  (To see the status of your commits)
git-checkout -- (To undo your commits)
git checkout HEAD -- filename (To replace filename with the one at HEAD)

For example, to clone the Sugar repository:

git-clone git://dev.laptop.org/sugar

To clone the PlayGo repository in the projects directory:

git-clone git://dev.laptop.org/projects/PlayGo

Git for OLPC

To get a project of yours hosted in our Git instance, see Project hosting.

OLPC GIT: http://dev.laptop.org/  (for tracking and submitting bugs and tasks)

    Wiki: http://dev.laptop.org/wiki
 Roadmap: http://dev.laptop.org/roadmap
 Sources: http://dev.laptop.org/browser
 Tickets: http://dev.laptop.org/query

Further Resources