Difference between revisions of "Git"
(→Installation) |
m (ok?) |
||
Line 1: | Line 1: | ||
− | + | A guide for people who would like to use git rather than subversion. | |
− | |||
− | |||
John Ralls has provided a git mirror of the Gramps subversion repository which is updated every 4 hours. | John Ralls has provided a git mirror of the Gramps subversion repository which is updated every 4 hours. | ||
Line 66: | Line 64: | ||
* http://www.tfnico.com/presentations/git-and-subversion | * http://www.tfnico.com/presentations/git-and-subversion | ||
* http://blog.tfnico.com/2011/09/git-svn-mirror-without-annoying-update.html | * http://blog.tfnico.com/2011/09/git-svn-mirror-without-annoying-update.html | ||
+ | |||
+ | [[Category:Developers/General]] |
Revision as of 08:59, 24 December 2012
A guide for people who would like to use git rather than subversion.
John Ralls has provided a git mirror of the Gramps subversion repository which is updated every 4 hours.
Contents
Installation
First install git and the git-svn bridge. In Ubuntu use the following command:
sudo apt-get install git git-svn
Note: The git package is called git-core in older distributions.
Next download a local copy of Gramps from the mirror provided by John Ralls. This will take about 5 minutes.
git clone -o mirror https://github.com/jralls/Gramps
Finally initialise the remote svn connection.
git svn init --prefix=mirror/ -s svn+ssh://<USERNAME>@svn.code.sf.net/p/gramps/code
Replace <USERNAME> with your SourceForge username.
Workflow
By default a branch called trunk is created for you. To update a branch with the latest changes in the git mirror use:
git pull --rebase
When committing changes to the subversion repository we need a linear histrory, so we specify the --rebase option.
To commit changes back to the subversion repository use:
git svn dcommit
Caution: Do not attempt to push changes back to the git mirror.
Branches
To see the remote branches available in the mirror use:
git remote show mirror
To create a new local tracking branch use the checkout command. For example, to create a branch that tracks the gramps34 maintenance branch use:
git checkout -b gramps34 mirror/maintenance/gramps34
The branch command allows you to see all the local branches and indicates which branch is active.
git branch
Before swithing to another branch it is useful to remove untracked files created by the build process. You can do this with the following command:
git clean -dxf
To switch to a branch use the checkout command. For example, to switch to trunk use:
git checkout trunk