Git and development branch

From VLE

Jump to: navigation, search

This documentation is reserved for the developers which want to have their own distant branches to a Git repository. This techniques allow a better integration of new source for VLE or packages rather than sending patch to the integrator.

Initialization of local and distant repositories

  • We build a distant repository, called vle-dev (for example), into the $HOME/git directory, on a computer accessible with ssh:
ssh -p 6999 login@www.vle-project.org
cd $HOME/git/
GIT_DIR=vle-dev.git git init --bare
cd vle-dev.git
chmod a+x hooks/post-update
touch git-daemon-export-ok
  • On the local machine, we clone the default VLE repository (from Sourceforge) in read access only and we attach a new remote branch:
git clone git://vle.git.sourceforge.net/gitroot/vle/vle
git branch -av
* master
  remotes/origin/HEAD
  remotes/origin/master
  remotes/origin/master0.5.0
  remotes/origin/master0.6.0
  remotes/origin/master0.7.0
  remotes/origin/master0.8.0
 
# We add a remote branch to the vle-dev repository build previously:
git remote add vle-dev ssh://login@www.vle-project.org:6999/home/login/git/vle-dev.git
 
# We publish the local master branch to the remote vle-dev master branch:
git push vle-dev master:master
 
# The remote branch vle-dev is now available:
git branch -av
* master
  remotes/origin/HEAD
  remotes/origin/master
  remotes/origin/master0.5.0
  remotes/origin/master0.6.0
  remotes/origin/master0.7.0
  remotes/origin/master0.8.0
  remotes/vle-dev/master

Send commits to the remote repository

  • Develop a lot of patchs on the local repository:
vim / emacs / eclipse / make / make install / make test
git commit -a
 
# Send the lot of patch to the remote repository:
git push vle-dev master:master
    # vle-dev: the name of your remote repository.
    # master: the name of the local branch (source of the commit).
    # master: the name of the distant branch (destination of the commit).

Synchronize your development with VLE official remote repository

In real life, you need to synchronise your local and remote repository to the VLE official repository.

  • First, you need to update the VLE official repository and merge your commits:
git checkout master         # switch on the master locale branch
git fetch origin            # update the VLE's remote repository.
git rebase -m origin/master # merge local commit with VLE's remote repository.

When a conflict occurs in the git rebase , follow the instruction and use git add [file] and git rebase --continue. When the conflicts are corrected, you need to send commits to your distant vle-dev repository.

  • To publish your new commits:
git push vle-dev +master:master
                        # the `+' force the command to send all commits.


This page was last modified on 7 July 2010, at 11:47. This page has been accessed 536 times.