- Category: Repositories
- Published on 07 May 2012
- Written by Mathieu Marache
- Hits: 6785
- git mirror
- Mirorring process
- Services Pros & Cons
As of March 2010, an experiment in mirroring the svn source repository to git has been started. Information on how to use and contribute are listed below.
git, obviously :
- on Windows :
- on Mac :
- on Linux
- git : command line : sudo apt-get install git-core
- gitk : graphical local repository browser : sudo apt-get install gitk
- git-gui : A Tcl/Tk based graphical user interface to Git sudo apt-get install git-gui
What is git anyway ?
Also have a look at Why git is better than X
This workflow is intended for users who need to stay on top of OpenSceneGraph activity but do not intend to modify it for they own need nor contribute some enhancements or bug correction back.
In case you are behind a restrictive firewall try opening TCP/IP port 9418 or use the http (slow) version as shown :
When planning to contribute to OpenSceneGraph you need to record your changes so they can be pulled into the upstream by the maintainer. This is largely inspired from Michael Norton's blog entry Doc On Dev : 'Contributing to a project you find on GitHub'
You will need a GitHub account
1. Fork the OpenSceneGraph project
Login to github. Go to http://github.com/openscenegraph/osg's git mirror project
To create a fork, press the "fork" button on the project's page.
When the fork is complete, you will have a copy of the project in your repositories listing.
2. Clone your project
Now back on your computer you need to clone your fork. Make sure you use the “Your Clone URL” and not the “Public Clone URL”. You want to be able to push changes back to your own repository.
Once the clone is complete your repo will have a remote named “origin” that points to your fork on github. You will use "origin" for your own regular activities.
3. Link your repository to the upstream
- repository that you forked
To keep track of the modifications committed to the 'upstream' branch of the project you need to add a remote branch to your local repository
You should now have another remote :
4. Create a branch containing your contribution
First step is to create a branch to make your modifications. Lets call it topic :
Now make your modifications to the project and commit them to your topic branch.
5. Keep your fork up-to-date
Forking a repository is the recommended way of contributing to a github project. Alas it doesn't get updated with the latest commits from the forked repository.
The upstream remote we added in the previous topic will help you update your repository with those latest changes by pulling and then merging in them in as so :
Now your local upstream/master should contain all the new commits. You can merge them to your master branch.
6. Keep your contributions up-to-date
When updating your repository with the upstream's modifications it is likely that your topic branch will need to integrate those changes too. This is called rebasing. This will modify your topic branch commits (yes, it will create some new commits) to make the topic branch start from the latest commits in the upstream repository.
7. Submitting your contribution
Work in Progress...
The mirroring process was fairly simple :
- use svn2git(my mirror added a --continue flag if the execution failed the svn fetch process) :
~ $ svn2git http://www.openscenegraph.org/svn/osg/OpenSceneGraph
- add remotes to push changes to
- create a shell script osg-svn2git.shto update and push changes
#!/bin/sh cd ~/OpenSceneGraph /usr/bin/git svn fetch /usr/bin/git merge trunk /usr/bin/git push --mirror gitorious /usr/bin/git push --mirror github
- add the shell script to the crontab
*/5 * * * * ~/osg-svn2git.sh
Services Pros & Cons
|downloads||+ source archive per tag||- manual upload of archives|