Personal tools
You are here: Home FAQ Howto... Work with additional repositories
Document Actions

Work with additional repositories

This How-to applies to: Any version.

Access non-official branches

Purpose

Our contributors are using git in a distributed fashion. You wish to access work that hasn't been integrated in the official repository just yet...

Most often this concerns experimental features or requests received via the user list

Prerequisities

You have a complete build system

This also assumes you have a repository cloned (usually from the official repo, so we will assume that the remote named 'origin' points to the official repo).

Step by step

 

Add the desired remote repositories to your local repository, e.g.

git remote add rainemu http://rainemu.swishparty.co.uk/git/zfs
git remote add MikeHommey git://git.debian.org/users/glandium/zfs-fuse.git

Update your remotes (fetching any remote branches)

git remote -v update

Show the available remote branches

git branch -r

From here you can take several routes, depending on the task at hand. Some typical examples of tasks would be:

Create a local branch to track the remote ('upstream') one:

git checkout -b myfeaturebranch MikeHommey/featurebranch

Rebase your patch(es) onto the remote branch so the remote maintainer can easily merge your changes into his branch:

git checkout my-fixes-branch
git rebase remote/maintained

Pull changes from the tracked remote branch:

git remote update remotename
git pull

Merge changes from another remote branch:

git checkout my-branch
git merge --ff --no-commit remote/otherbranch

Note: 

  • passing --ff tries to pull commits that are compatible without rebasing them. This is actually not a merge but a copy of commits. You could --ff-only if you knew everything should be a fast forward (your branches have shared ancestors and haven't diverged). 
  • --no-commit allows you to review the changes (git diff --cached and git log --merge) before actually committing the merge on your branch

Further information

See the Wiki for a semi-up-to-date list of public repositories for zfs-fuse.

Please add your own repositories there, so people won't have to hunt the user group repeatedly for that URL.

Again, Git-magic is recommended reading