Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changes between Version 3 and Version 4 of code/tools/Git


Ignore:
Timestamp:
Sep 13, 2010, 11:18:03 PM (14 years ago)
Author:
adrfried
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • code/tools/Git

    v3 v4  
    11= Using Git for Orxonox =
    22
    3 Git may be used by experienced users, who want to use Git's advanced features for developing Orxonox.
     3Git 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.
    44
    55== Initial Checkout ==
    66
     7=== via Adi's git repository ===
     8
     9You 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
     13git init orxonox
     14cd orxonox
     15# You may omit the host name and the colon if you are doing this on a Tardis computer
     16git remote add origin login.ee.ethz.ch:~adrfried/orxonox.git
     17git config --replace-all remote.origin.fetch '+refs/remotes/svn/*:refs/remotes/svn/*'
     18git fetch
     19# Checkout SVN trunk as the local master branch
     20git checkout -b master svn/trunk
     21}}}
     22
     23Now 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
     27git 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
     29git svn rebase
     30}}}
     31
    732=== Directly from SVN ===
    833
    9 To checkout orxonox' [wiki:SVN]-Repository in Git use:
     34Alternatively you may also checkout Orxonox' [wiki:SVN]-Repository in Git directly.
    1035
    1136{{{
     
    1742{{{--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.
    1843
    19 === via Adi's git repository ===
     44== Basic Git Configuration ==
    2045
    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:
     46Set your full name and email address.
    4347
    4448{{{
     
    4751}}}
    4852
    49 Some fancy colors:
     53Some fancy colors.
    5054
    5155{{{
     
    5559The {{{--global}}} argument tells git to store the config in .gitconfig in your home, so these will be usable for every git repository you have.
    5660
    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 
    6361== Basic Usage ==
    6462
    65 Pull changes from SVN to your local Git Repository:
     63Get the latest changes from SVN in the current branch and rebase all local changes onto it.
    6664
    6765{{{
     
    6967}}}
    7068
    71 Commit local changes and push them to the SVN:
     69Commit local changes and push them to the SVN.
    7270
    7371{{{