Version 2 (modified by adrfried, 14 years ago) (diff) |
---|
Using Git for Orxonox
Git may be used by experienced users, who want to use Git's advanced features for developing Orxonox.
Initial Checkout
Directly from SVN
To checkout orxonox' SVN-Repository in Git use:
git svn clone --stdlayout --prefix=svn/ https://svn.orxonox.net/game/code orxonox
This will check out the whole history of the Project code with all the branches and tags, it will use about 150 MB of disk space and it may take a long time (while checking out it will use more disk space, until things get automatically compressed by git gc).
--stdlayout tells git-svn to follow the common "trunk/branches/tags" layout. --prefix=svn/ prefixes the remote branches with svn/, similar to the usual origin/, otherwise you would not be able to have a local branch with the same name as in svn.
via Adi's git repository
Alternatively you can clone from Adi's git repository on his Tardis account which is much faster. This requires SSH access on Tardis.
mkdir orxonox cd orxonox # we are not using git clone here, because we want to track some other references git init # omit the host name and the colon if you are doing this on a Tardis computer git remote add origin tardis-c07.ee.ethz.ch:/home/adrfried/orxonox.git git config --replace-all remote.origin.fetch '+refs/remotes/*:refs/remotes/*' git fetch # check out trunk as master git checkout -b master svn/trunk # initialize git-svn git svn init --stdlayout --prefix=svn/ https://svn.orxonox.net/game/code # get the latest changes from svn git svn rebase
Basic Configuration
Set your full name and email address:
git config --global user.name "Your Name Comes Here" git config --global user.email you@yourdomain.example.com
Some fancy colors:
git config --global color.ui auto
The --global argument tells git to store the config in .gitconfig in your home, so these will be usable for every git repository you have.
Add something like this to your .bashrc for having a nice, git-aware bash prompt, which shows the current branch you are on and sometimes some other stuff:
PS1='\u@\h:\w$(__git_ps1 " (%s)")\$ '
Basic Usage
Pull changes from SVN to your local Git Repository:
git svn rebase
Commit local changes and push them to the SVN:
git commit -a git svn dcommit
Branches
To checkout another branch than trunk, e.g. the presentation branch use:
git checkout -b presentation3 svn/presentation3 git svn rebase
This will create a local branch named presentation3. You can simply switch between local branches with git checkout <branch>
Documentation
To learn more about git see: http://git-scm.com/documentation