Git Instructions

From PiTiViWiKi

Jump to: navigation, search

Detailed instructions for PiTiVi git are listed here.

Maybe you were looking for Welcome Developers

Contents

Using Git!

GIT is a very popular Distributed Revision Control System used by the kernel, X, etc... Git allows people (you, me) to quickly get checkouts (with full history), create your own branches, publish those, etc... without the need for access to the central repository (that would be you).

NOTE: You will need git installed on your system. It is available through your package system (I'll let your instincts and knowledge guide you).


Debian/Ubuntu

sudo apt-get install git-core

Checking out git.pitivi.org pitivi repository

You do the initial checkout as follow:

git clone git://git.pitivi.org/git/pitivi.git

It helps to give a name to that remote repository you are cloning. So let's say we name it pitivi and we'll therefore do the initial checkout as such:

git clone -o pitivi git://git.pitivi.org/git/pitivi.git

You should now have a directory called pitivi with the latest version of the files checked out. You are in the master branch.

You can see all available branches by using the git branch command:

git branch

This shows you the local branches you have... and here you will see only one currently : master. The branch you are working in is marked with an asterisk (*).

You can view all branches, including the remote ones as such:

git branch -a

You'll notice that it shows you all the branches available from the pitivi.org/pitivi.git repository.

Creating a work branch

It is good practice never to do work on the master branch. Therefore you need to create a work branch :

 git branch work master

If you use git branch you will now see your new branch... but you are still in master.

To switch to your work branch you need to check it out using:

 git checkout work

And it tells you it has successfully switched to the work branch.

tip: you can branch and checkout in one step using the -b <new_branch> option of git checkout Therefore the two steps above become:

 git checkout -b work master

Committing/Adding files

See the git tutorial for this : http://www.kernel.org/pub/software/scm/git/docs/gittutorial.html

Adding remote repositories

This is where one of the handiest parts of git come into place. Everybody can create and publish their own version of the repository and all view them from one place.

Let's add a remote repository to our git checkouts:

 git remote add edward git://git.pitivi.org/git/user/bilboed/pitivi.git

Or in a more generic fashion:

 # git remote add <local_name> <git_url>

This command only informs git that we want to track that remote repository, we now need to fetch the information stored in there by using the git fetch command.

 git fetch edward
 # git fetch <remote_name>

By using git branch -a you will now see that new remote branches have appeared, check out those branches, have a look at the work, etc...

Tip: If you have following several remotes, you can update them all in one go with:

 git remote update

Publishing your work

Several free git hosting services exist out there where you can create very quickly some repositories and publish your branch there. They will contain information on how to add your publishing remote URL (it's the same syntax as adding a remote repository just above btw, no magic involved).

Let's say you created a working branch locally (called mytest) and that you named your remote repository myremote, and you want to publish it so people can see what you have done, try it out, etc...

The first time you will have to tell git where you want to push that branch:

 git push myremote mytest

This will automatically:

  • Create a mytest branch on your remote repository
  • Copy over all the commits
  • Make git remember where that branch is stored remotely

The next time you want to push your work remotely, you just to be within that branch and do:

 git push

Not going insane

You are very quickly going to have a lot of branches. There are graphical tools to view what you have locally, one comes with git : gitk , although I have a preference for giggle which has a gtk interface.

Those tools will allow you

PiTiVi Git repositories

This will list all know git repositories that are based off the official git.pitivi.org repository.

Official Repository

  • contents : offical master branch, release branch, various other braches
  • Repositiory : git://git.pitivi.org/git/pitivi

GNOME repository

NOTE: this is a mirror of the official repository.

Edward's repository

Brandon's github repository

Alessandro's repository

Stephen's repository

Personal tools