FlightGear Git: Difference between revisions

Jump to navigation Jump to search
m
some corrections to the previous edit
(Added git commands and fgdata.bundle)
m (some corrections to the previous edit)
Line 42: Line 42:
: the folder ''target'' will be created and a clone of the SimGear repo stored inside it. If no ''target'' is given the new folder's name is <code>simgear</code>.
: the folder ''target'' will be created and a clone of the SimGear repo stored inside it. If no ''target'' is given the new folder's name is <code>simgear</code>.


<b><code>cd</code></b> into the new folder. You are then inside the ''working directory'' of this git repo. The repo itself is stored inside the subfolder <tt>.git</tt>, which we mustn't edit manually. Git will take care of that.
<b><code>cd</code></b> into the new folder. You are then inside the ''working tree'' of this git repo. The repo itself is stored inside the subfolder <tt>.git</tt>, which we mustn't edit manually. Git will take care of that.


;<code>git branch</code>
;<code>git branch</code>
: will show the active [[FlightGear_and_Git#Repositories and Branches|branch]]. Right after download this will be <tt>* next</tt>, that means the content of the ''working directory'' is the bleeding edge of SimGear's source code.
: will show the active [[FlightGear_and_Git#Repositories and Branches|branch]]. Right after download this will be <tt>* next</tt>, that means the content of the ''working tree'' is the bleeding edge of SimGear's source code.
:;<code>git branch -a</code>
:;<code>git branch -a</code>
:: will list all branches of a git repository. The one marked with an asterisk (*) is the active one.
:: will list all branches of a git repository. The one marked with an asterisk (*) is the active one.


;<code>git checkout master</code>
;<code>git checkout master</code>
: will change the active [[FlightGear_and_Git#Repositories_and_Branches|branch]] to <tt>master</tt>. Means, that the content of the ''working directory'' will be changed to that state.
: will change the active [[FlightGear_and_Git#Repositories_and_Branches|branch]] to <tt>master</tt>. Means, that the content of the ''working tree'' will be changed to that state.


:;<code>git checkout v2.0.0</code>
:;<code>git checkout v2.0.0</code>
Line 64: Line 64:
Except for the initial clone command this is identic to [[FlightGear_and_Git#Cloning_SimGear|Cloning SimGear]].
Except for the initial clone command this is identic to [[FlightGear_and_Git#Cloning_SimGear|Cloning SimGear]].
;<code>git clone git://gitorious.org/fg/flightgear.git [target]</code>
;<code>git clone git://gitorious.org/fg/flightgear.git [target]</code>
To successfully compile <code>fgfs</code> Sim- and FlightGear's repositories must have the same state.
To successfully compile <code>fgfs</code> Flight- and SimGear's ''working tree'' must have the same state.




==== Cloning fgdata ====
==== Cloning fgdata ====
At the time of writing the data repository is about 2.5 GB of size. Revisit an interrupted cloning of a repository is *not* possible with git. Therefore, if you have a slow or unstable connection to the internet, it is recommended to download the [[FlightGear_and_Git#fgdata.bundle|fgdata.bundle]].
At the time of writing the data repository is about 2.5 GB of size. Revisit an interrupted cloning of a repository is <b>not</b> possible with git. Therefore, if you have a slow or unstable connection to the internet, it is recommended to download the [[FlightGear_and_Git#fgdata.bundle|fgdata.bundle]].


Also have in mind, that the repository plus the ''working directory'' will be more than twice the size of the download on your local filesystem.
Also have in mind, that the repository plus the ''working tree'' will be more than twice the size of the download on your local filesystem.


There is neither a <tt>next</tt> branch nor any tags in that repository. If you want to get FlightGear 2.0.0 you may fetch the data (FlightGear-data-2.0.0.tar.bz2) at one of the [http://flightgear.org/mirrors.html mirrors].
There is neither a <tt>next</tt> branch nor any tags in that repository. If you want to build FlightGear 2.0.0 you may fetch the data (FlightGear-data-2.0.0.tar.bz2) at one of the [http://flightgear.org/mirrors.html mirrors].


;<code>git clone git://mapserver.flightgear.org/fgdata/ [target]</code>
;<code>git clone git://mapserver.flightgear.org/fgdata/ [target]</code>
Line 79: Line 79:




==== Individual Branch ====
==== Local Branch ====
To make individual changes, like adding/editing a joystick file to fgdata or patch the source code, it is recommended to create an individual branch inside that repository:
To make individual changes, like adding/editing a joystick file to fgdata or patch the source code, it is recommended to create a local branch inside that repository:


<b><code>cd</code></b> into the repositories folder, e.g. fgdata:
<b><code>cd</code></b> into the repositories folder, e.g. fgdata:
;<code>git checkout -b master.individual master</code>
;<code>git checkout -b master.local master</code>
: a new branch <tt>master.individual</tt> is created out of the <tt>master</tt> branch and set as the active one. You may apply your individual stuff there.
: a new branch <tt>master.local</tt> is created out of the <tt>master</tt> branch and set as the active one. You may apply your individual stuff there.


To update that individual branch from the remote one do the following steps:
To update that personal branch from the remote one do the following steps:
  git checkout master             # switch to master branch
  git checkout master           # switch to master branch
  git pull                         # update it
  git pull                     # update it
  git checkout master.individual  # switch back to the individual branch
  git checkout master.local    # switch back to the individual branch
  git rebase next                  # update it
  git rebase master            # update it




Line 99: Line 99:
: apply a patch to files and/or to the index http://www.kernel.org/pub/software/scm/git/docs/git-apply.html
: apply a patch to files and/or to the index http://www.kernel.org/pub/software/scm/git/docs/git-apply.html
;<code>git checkout -f</code>
;<code>git checkout -f</code>
: is used to throw away any local changes to a repository. Use with care, as any option that name is <tt>-f</tt> or <tt>--force</tt>!
: may be used to throw away any local changes to the ''working tree''. Use with care, as any option that name is <tt>-f</tt> or <tt>--force</tt>, and only after reading <code>git checkout help</code>!




=== fgdata.bundle ===
=== fgdata.bundle ===
For the FlightGear-data there are also bundles (snapshots) available that can be retrieved with your favorite download manager. This way you can resume interrupted downloads. After unpacking only a comparatively small amount of data has to be transferred from the git server to synchronize your repository.
For the FlightGear-data there are also bundles (snapshots) available that can be retrieved with your favourite download manager. This way you can resume interrupted downloads. After unpacking only a comparatively small amount of data has to be transferred from the git server to synchronize your repository.


Download the bundle from
Download the bundle from
392

edits

Navigation menu