FlightGear Git on Windows: Difference between revisions

Jump to navigation Jump to search
Start cleanup, syntaxhighlight, etc
mNo edit summary
(Start cleanup, syntaxhighlight, etc)
Line 1: Line 1:
{{outdated}}
{{FlightGearGitOn}}
{{FlightGearGitOn}}
This document guides you through the installation process of the development version of [[FlightGear]] ([[Git]]) on Windows.
 
This document is intended to guide you through the installation of the development version of [[FlightGear]] through [[Git]] on Windows.


== Different needs ==
== Different needs ==
There are two kinds of people who would install Git - those who intend doing development, and those who just want to have the latest and greatest version. The big difference is the amount of data that needs to be downloaded. Another important factor is your Internet connection speed and the amount of bandwidth you have. This affects the way in which you do your downloading.
There are two kinds of people who would install Git those who intend doing development, and those who just want to have the latest and greatest version.


Developers need the entire history of Flightgear so that they can push changes, cutting-edge users just need the latest version of each file.
The big difference is the amount of data that needs to be downloaded.  Another important factor is your Internet connection speed and the amount of bandwidth you have.  This affects the way in which you can do your downloading.


The various sub-headings will show whether they are intended for developers, users or all.
Developers need the entire history of FlightGear so that they can push changes, whereas cutting-edge users just need the latest version of each file.


The various headings will indicate whether they are intended for developers, users or both.


'''Note:''' Where this document refers to your "release copy of FlightGear," it means the copy of FlightGear that you downloaded from the FlightGear website.


== Pre-installation work (All) ==
== Pre-installation work (both) ==
We need to choose an installation directory which is different to the one where your release copy is installed. The folders you create must be empty. This can be any drive on your computer. In this document, we assume that you install FlightGear on the D: drive. Just replace the commands given in this document by your installation directory when using another drive or different directory root.
We need to choose an installation directory which is different to the one where your release copy of FlightGear is installed. The folders you create must be empty. This can be any drive on your computer. In this document, we assume that you are installing FlightGear on the D drive. Just replace the commands given in this document by your installation directory when using another drive or different directory root.


Create the following directories on your drive:
Create the following directories on your drive:
* <code>FlightGear</code>
** <code>bin</code>
** <code>data</code>


* <tt>FlightGear</tt>
You will notice that this is identical to the folder structure of of your working copy of FG.
** <tt>bin</tt>
** <tt>data</tt>
 
In fact, it is identical to the folder structure of your working copy of FG.
 
 
 
== A first Git install (Develop) ==


== A first Git install (developer) ==
=== Obtaining data from Git ===
=== Obtaining data from Git ===
You can use any Git software; however, msysGit will be used in this document.  You can download from [https://github.com/msysgit/msysgit/releases/latest here].  At the bottom, below the "Downloads" heading, click on the link that has a format similar to <code>Git-1.9.5-preview20150319.exe</code>.  Clicking on this link will begin the download.  When the file has finished downloading, begin the installation by double-clicking on it and following the installation instructions that show up on your screen.


You can use any Git software, however we advise to use msysGit (which will be used in this document). You can download it through [http://code.google.com/p/msysgit/downloads/list this link]. Select the one with the Summary that says "Full installer for official Git for Windows." The file name will be similar to this: Git-x.x.x-previewyyyyddmm.exe. x.x.x s the version number. Choose the highest (newest) one. Follow the download/installation instructions that show up on your screen.
The amount of data to download (as of msysGit version 1.9.5) is  17.1 GB, so if you have a slow Internet connection, limited bandwidth per month or you cannot keep your computer on for the long time that it takes for the data to download from the Git server, follow Method 2.


The amount of data to download is currently 5GB (and will grow over the years) so, if you have a slow internet connection or limited bandwidth per month or you cannot keep your computer on for the long time that it takes for the data to download from the git server, follow Method 2.
==== Method 1 ====
[[File:Msysgit clone fgdata.jpg|thumb|270px|The Git BASH window]]
Before starting, confirm that the folder you're using '''does not''' contain an existing copy of FlightGear!


==== Method 1: ====
Open Git BASH via <code>C:/Program Files/msysgit/Git Bash</code> (or via the shortcut) and run (replacing the path with the correct path on your system):
Before starting, confirm that the folder you're using DOES NOT contain an existing copy of FlightGear!
<syntaxhighlight lang="bash">
cd "D:/FlightGear/data"
</syntaxhighlight>


[[File:msysgit_clone_fgdata.jpg|thumb|270px|The Git Bash window]]
Then, run the following command, to initialize a Git repository. This should create a <code>.git</code> folder in the <code>FlightGear/data</code> folder (although it may be a folder):
Open Git Bash via <tt>C:\Program Files\msysgit\Git Bash</tt> (or open via the shortcut) and run (replacing the path with your preferred path):
<syntaxhighlight lang="bash">
cd D:/FlightGear/data
git init
</syntaxhighlight>


In the event that the program refuses to change directory, try this instead:
Next, run this command:
cd "D:/FlightGear/data"
<syntaxhighlight lang="bash">
git clone git://git.code.sf.net/p/flightgear/fgdata
</syntaxhighlight>


or, in some cases:
{{Note|This command can take up to a couple of hours on slow Internet connections.}}
cd D:
cd Flightgear/data


(replace the above paths with whatever you have created.)
Now msysGit will pull the entire [[fgdata]] package into your <code>FlightGear/data</code> directory.


Then run the following, to initialise a Git repository. This should create a .git folder in data/. (It will probably be a hidden folder.)
{{Note|Some files demand that CR/LF (carriage return/line feed) line breaks are preserved. To avoid errors or problems later, run these commands:
git init
<syntaxhighlight lang="bash">
 
git config --global core.autocrlf true
Add the following command and press Enter.
git config --global core.safecrlf true
 
</syntaxhighlight>
git clone git://gitorious.org/fg/fgdata.git
}}
 
Now msysGit will pull the entire fgdata package into your <tt>FlightGear\data</tt> directory. '''This can take up to a couple of hours on slow internet connections!'''
 
'''IMPORTANT:''' Be sure you use msysGit 1.7.0.2 or newer version, as previous versions have problems with large repositories, and won't download more than 2Gb of data.
 
'''IMPORTANT II:''' Some files demand that CR/LF (carriage return / line feed) line breaks are kept in the way they are stored on Gitorious. Make sure to set "git-config core.safecrlf true" and "git-config core.autocrlf false" in your options or you may receive nasty error or even a crash on startup of FG (e.g. fgtzfile_read(): : Invalid argument... Fatal error: Timezone reading failed).


==== Method 2: ====
==== Method 2 ====
Download the <tt>fgdata.bundle</tt> from or http://flightgear.mxchange.org/pub/fgfs/. Use <tt>Right mouseclick > Save target as</tt> on the file, if you end up with a webpage full of weird characters.
Download the <tt>fgdata.bundle</tt> from or http://flightgear.mxchange.org/pub/fgfs/. Use <tt>Right mouseclick > Save target as</tt> on the file, if you end up with a webpage full of weird characters.


Line 73: Line 73:
Copy this file to your <tt>FlightGear\data</tt> directory.
Copy this file to your <tt>FlightGear\data</tt> directory.


Open Git Bash via <tt>C:\Program Files\msysgit\Git Bash</tt> (the shortcut) and run (replacing the path with your preferred path):  
Open Git Bash via <tt>C:\Program Files\msysgit\Git Bash</tt> (the shortcut) and run (replacing the path with your preferred path):
cd D:/FlightGear/data
<syntaxhighlight lang="bash">
git clone fgdata.bundle
cd D:/FlightGear/data
git clone fgdata.bundle
</syntaxhighlight>


Now msysGit will expand the entire fgdata.bundle package into <tt>FlightGear\data\fgdata</tt>.
Now msysGit will expand the entire fgdata.bundle package into <tt>FlightGear\data\fgdata</tt>.
Line 91: Line 93:


run this command:
run this command:
cd fgdata
<syntaxhighlight lang="bash">
cd fgdata
</syntaxhighlight>


and press enter
and press enter
then
then
git checkout -b master origin/master
<syntaxhighlight lang="bash">
git checkout -b master origin/master
</syntaxhighlight>


It should be fixed now. Go back to Flightgear/data.
It should be fixed now. Go back to Flightgear/data.


Now pull from GIT to update to the latest files using  
Now pull from GIT to update to the latest files using  
<syntaxhighlight lang="bash">
git pull git://gitorious.org/fg/fgdata.git master
git pull git://gitorious.org/fg/fgdata.git master
</syntaxhighlight>


== A first Git install (User) ==
== A first Git install (User) ==
Line 107: Line 114:
=== Obtaining data from Git ===
=== Obtaining data from Git ===
Open Git Bash via <tt>C:\Program Files\msysgit\Git Bash</tt> (or open via the shortcut) and run (replacing the path with your preferred path):
Open Git Bash via <tt>C:\Program Files\msysgit\Git Bash</tt> (or open via the shortcut) and run (replacing the path with your preferred path):
cd D:/FlightGear/data
<syntaxhighlight lang="bash">
cd D:/FlightGear/data
</syntaxhighlight>


In the event that the program refuses to change directory, try this instead:
In the event that the program refuses to change directory, try this instead:
cd "D:/FlightGear/data"
<syntaxhighlight lang="bash">
cd "D:/FlightGear/data"
</syntaxhighlight>


or, in some cases:
or, in some cases:
cd D:
<syntaxhighlight lang="bash">
cd Flightgear/data
cd D:
cd Flightgear/data
</syntaxhighlight>


(replace the above paths with whatever you have created.)
(replace the above paths with whatever you have created.)


Then run the following, to initialise a Git repository. This should create a .git folder in data/. (It will probably be a hidden folder.)
Then run the following, to initialise a Git repository. This should create a .git folder in data/. (It will probably be a hidden folder.)
git init
<syntaxhighlight lang="bash">
git init
</syntaxhighlight>


Add the following command and press Enter.
Add the following command and press Enter.
git pull --depth 1 git://gitorious.org/fg/fgdata master
<syntaxhighlight lang="bash">
git pull --depth 1 git://gitorious.org/fg/fgdata master
</syntaxhighlight>


This can be 3GB or more. Unfortunately, there is no way of doing pause and resume.
This can be 3GB or more. Unfortunately, there is no way of doing pause and resume.

Navigation menu