Q:

Git - need some explanations about rebase

I tried google, no help.
I got an active os project that keeps updating with good stuff and I'm developing on top of it,
So lets say I got the git repository of the project (lets call the current state x) and the current status is:
OS project
x

my project (added some y changes)
x -> y

Now OS project updated :
x -> z

and I wan't my project to contain z and look like
x -> z -> y

or 
z -> y

Can someone explain how do I make it happen?

A:

The simple method is to use the following two commands (after you've stached or committed your changes):
$ git fetch origin master
$ git rebase FETCH_HEAD

The first one fetches the changes in original repository from the remote named 'origin'. The second one moves your changes to the new remote HEAD.
The important thing to note here is that you use git fetch and not git pull. The latter is a fetch followed by an automatic merge. You don't want that.
In case you are looking for an alternative method, I always work on my separate branch. Then I can keep master equal to the maintainer's version, and I can keep rebasing my parallel branch. If there are other users of my branch I merge the master into it instead.

