Activity Team/Git Tutorial

From Sugar Labs
Jump to navigation Jump to search

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


Getting started with Gitorious.

Create an account

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

Enter your

  • Login
  • Email
  • Password
  • Password confirmation

Follow link on email confirmation

Create SSH Key


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
# 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:

4. I added the pootle user as a committer.
5. Where should I put the .xo bundle? And the source tarball?
there is a script for generating and posting changes that covers all of these details.

I had a bit of trouble pushing a new change to gitorious today. I had to use the --force flag for some reason. We suspect it may have something to do with the fact that one of the files I pushed is a binary file. Will report back what I find. (Seems to work fine when there are no binary files to add/push.)

git push -fv

I have been trying to use with no luck so far either. (It has a dependency on the feedparser python library, which is easy enough to install.) It complained about a mismatched tag, so I used the --version flag to force the same version number as in my file. Then I got this error:

nothing added to commit but untracked files present (use "git add" to track)
Traceback (most recent call last):
 File "../", line 325, in <module>
 File "../", line 314, in main
 File "../", line 170, in tag
   subprocess.check_call(['git', 'commit', '-a', '-m' , '%s' % message])
 File "/usr/lib/python2.5/", line 462, in check_call
   raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['git', 'commit', '-a', '-m', 'Release 26']' returned non-zero exit status 1

Is this because I did the git commit and git push by hand before running



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

Also, run

python 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:// master

A few notes re moving to the Sugar Labs infrastructure:

  • use git init to create a new project
  • source packages now go in
  • don't forget to update addons as well!!
  • and to copy the tar file to