Changes between Version 3 and Version 4 of code/tools/Git
- Timestamp:
- Sep 13, 2010, 11:18:03 PM (14 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
code/tools/Git
v3 v4 1 1 = Using Git for Orxonox = 2 2 3 Git may be used by experienced users, who want to use Git's advanced features for developing Orxonox. 3 Git may be used by experienced users, who want to use Git's advanced features for developing Orxonox. This page describes how to use git-svn together with Orxonox' SVN. 4 4 5 5 == Initial Checkout == 6 6 7 === via Adi's git repository === 8 9 You can clone from Adi's Git repository from his Tardis account which is '''much faster''' than getting each commit via SVN. This requires SSH access on Tardis. 10 11 {{{ 12 # We are not using git clone here, because we want to track some other references 13 git init orxonox 14 cd orxonox 15 # You may omit the host name and the colon if you are doing this on a Tardis computer 16 git remote add origin login.ee.ethz.ch:~adrfried/orxonox.git 17 git config --replace-all remote.origin.fetch '+refs/remotes/svn/*:refs/remotes/svn/*' 18 git fetch 19 # Checkout SVN trunk as the local master branch 20 git checkout -b master svn/trunk 21 }}} 22 23 Now you may initialize git-svn. You may also do this at a later point and just use Git without git-svn for now. 24 25 {{{ 26 # Initialize git-svn 27 git svn init --stdlayout --prefix=svn/ https://svn.orxonox.net/game/code 28 # Get the latest changes from SVN in the current branch and rebase all local changes onto it 29 git svn rebase 30 }}} 31 7 32 === Directly from SVN === 8 33 9 To checkout orxonox' [wiki:SVN]-Repository in Git use: 34 Alternatively you may also checkout Orxonox' [wiki:SVN]-Repository in Git directly. 10 35 11 36 {{{ … … 17 42 {{{--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. 18 43 19 == = via Adi's git repository ===44 == Basic Git Configuration == 20 45 21 Alternatively you can clone from Adi's git repository on his Tardis account which is '''much faster'''. This requires SSH access on Tardis. 22 23 {{{ 24 mkdir orxonox 25 cd orxonox 26 # we are not using git clone here, because we want to track some other references 27 git init 28 # omit the host name and the colon if you are doing this on a Tardis computer 29 git remote add origin login.ee.ethz.ch:~adrfried/orxonox.git 30 git config --replace-all remote.origin.fetch '+refs/remotes/*:refs/remotes/*' 31 git fetch 32 # check out trunk as master 33 git checkout -b master svn/trunk 34 # initialize git-svn 35 git svn init --stdlayout --prefix=svn/ https://svn.orxonox.net/game/code 36 # get the latest changes from svn 37 git svn rebase 38 }}} 39 40 == Basic Configuration == 41 42 Set your full name and email address: 46 Set your full name and email address. 43 47 44 48 {{{ … … 47 51 }}} 48 52 49 Some fancy colors :53 Some fancy colors. 50 54 51 55 {{{ … … 55 59 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. 56 60 57 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:58 59 {{{60 PS1='\u@\h:\w$(__git_ps1 " (%s)")\$ '61 }}}62 63 61 == Basic Usage == 64 62 65 Pull changes from SVN to your local Git Repository: 63 Get the latest changes from SVN in the current branch and rebase all local changes onto it. 66 64 67 65 {{{ … … 69 67 }}} 70 68 71 Commit local changes and push them to the SVN :69 Commit local changes and push them to the SVN. 72 70 73 71 {{{