Title

Git: Share with Others

There are many different ways to share the changes in your git repository with other people, We are going to focus on 4 versions which should cover most cases. Our 4 cases are as follows: just as the pull method, each member needs to pull in changes from another user. The patch method, setting up a "central server", using github.

Pulling updates from others

Pulling updates from others is easy, it is just like making a copy of your repository. If you are pulling updates you want to make sure you have committed all current changes, so you have a "clean tree". You just go into your repository and specify where you want to pull from:

% cd mylocalgitproject

% git pull --rebase /project/mein/myproject

Patches

You can now see how your code differs from the branch you pulled or cloned from by issuing the following command:

% git diff origin

Then you can also make a patch by using:

% git diff origin > ~/myfile.diff

And people can apply that patch to their own branch by executing the following command inside of their git dir: