Difference between revisions of "Getting the source"

From Unvanquished
Jump to: navigation, search
(Linux)
(Downloading the source)
 
(42 intermediate revisions by 7 users not shown)
Line 1: Line 1:
==Overview==
+
{{Note|content=The recommended way to fetch the sources is to use Git to clone the repository.
 +
 
 +
The [https://github.com/Unvanquished/Unvanquished Unvanquished source code] is hosted on GitHub.
 +
 
 +
Downloading a snapshot of the source code in archive form isn't tested.}}
  
 
==Installing Git==
 
==Installing Git==
  
If you already have Git installed, you can skip this step.
+
{{InfoGit|page=true}}See [[Tools/Git#Installing Git|Installing Git]].
  
===Windows===
+
==Downloading the source==
  
Windows users can acquire git from the [http://code.google.com/p/msysgit/ MSysGit project]. If you would prefer a graphical front-end, there is [http://code.google.com/p/tortoisegit/ TortoiseGit], but regardless MSysGit must be installed.
+
{{Note|content=In case this happens to become outdated, the up-to-date documentation can be found in the {{SourceFile|parameters=#unvanquished|README.md}} file in source repository.}}
  
===Mac OS X===
+
===Command line===
  
Apple has included Git with Xcode since version 4. You may download [https://developer.apple.com/xcode/ Xcode] from  Apple's developer website.
+
The following commands will work on any platform.
  
===Linux===
+
<pre>git clone --recurse-submodules https://github.com/Unvanquished/Unvanquished.git</pre>
  
====Debian & Ubuntu====
+
This will create a directory called ''Unvanquished''.
  
Install git using the package manager:
+
If you already cloned but forgot to use the {{code|--recurse-submodules}} option:
  
  $ sudo apt-get install git
+
  cd Unvanquished
 +
git submodule update --init --recursive
  
==Downloading the source==
+
If you would like to get the source for a particular version, [http://git-scm.com/docs/git-checkout check out] the associated [http://git-scm.com/book/en/Git-Basics-Tagging tag]:
  
The [https://github.com/Unvanquished/Unvanquished Unvanquished source code] is hosted on GitHub. You can either download a snapshot of the source code using the "ZIP" link, or you can use git to clone the repository.
+
cd Unvanquished
 +
git checkout {{Current|GameTag}}
  
===Linux===
+
To see the list of tags (versions) available to check out,
  
Use git on the command line:
+
git tag
  
$ git clone https://github.com/Unvanquished/Unvanquished.git
+
will produce a list.
  
This will create a directory called <code>Unvanquished</code> in your home folder.
+
===Linux===
 +
 
 +
Please see the [[#Command_line|command line]] instructions.
  
===Mac OS X===
+
===macOS===
  
 
====Command Line====
 
====Command Line====
  
Acquiring the source code using the command line is the same as on Linux. Just open a Terminal (/Applications/Utilities/Terminal) window and clone the source code like so:
+
Open a Terminal (<code>/Applications/Utilities/Terminal</code>) and follow the [[#Command_line|command line]] instructions.
 
+
$ git clone https://github.com/Unvanquished/Unvanquished.git
+
  
 
====Xcode 4====
 
====Xcode 4====
  
 
# Start Xcode.
 
# Start Xcode.
# Open the Organizer window (Window &rarr; Organizer or <span class="hotkey">Shift</span>+<span class="hotkey">Command&nbsp;&#x2318;</span>+<span class="hotkey">2</span>)
+
# Open the Organizer window (Window &rarr; Organizer or {{Hotkey|Shift}}{{Hotkey|MacCommand}}{{Hotkey|2}})
# Click the "Repositories" button on the top bar.
+
# Hit the "Repositories" button on the top bar.
# Click the "+" button in the lower-left corner, and choose "Checkout or Clone Repository&hellip;".
+
# Hit the "+" button in the lower-left corner, and choose "Checkout or Clone Repository&hellip;".
# In the rollout sheet that appears, enter <code>https://github.com/Unvanquished/Unvanquished.git</code> into the "Location" field, and click "Next".
+
# In the rollout sheet that appears, enter <code>https://github.com/Unvanquished/Unvanquished.git</code> into the "Location" field, and hit "Next".
# Enter "Unvanquished" into the "Name" field, ensure that the "Type" combo box is set to "Git", and click "Clone".
+
# Enter "Unvanquished" into the "Name" field, ensure that the "Type" combo box is set to "Git", and hit "Clone".
# You will be prompted where to save the repository. Choose a location and click "Clone".
+
# You will be prompted where to save the repository. Choose a location and hit "Clone".
  
 
===Windows===
 
===Windows===
Line 58: Line 64:
 
# Right click the inside of the folder &rarr; Git Clone...
 
# Right click the inside of the folder &rarr; Git Clone...
 
# In the Url textbox enter: <code>https://github.com/Unvanquished/Unvanquished.git</code>
 
# In the Url textbox enter: <code>https://github.com/Unvanquished/Unvanquished.git</code>
# Click ok.
+
# Hit OK.
  
 
====Command Line====
 
====Command Line====
Open the MsysGit terminal and type:
+
 
$ git clone https://github.com/Unvanquished/Unvanquished.git
+
Open the MsysGit terminal and and follow the [[#Command_line|command line]] instructions.
 +
 
 +
==Keeping your copy of the source up-to-date==
 +
 
 +
For more information on using git, an excellent resource is the official [http://git-scm.com/book git book], available to read online for free.
 +
 
 +
===TortoiseGit===
 +
 
 +
# Right-click somewhere in the source directory, and choose "Git Sync".
 +
 
 +
{{TODO|Finish instructions.}}
 +
 
 +
===Command-line (All platforms)===
 +
 
 +
{{Note|content=
 +
If you have checked out a particular commit or tag (e.g., <code>{{Current|GameTag}}</code>), git will inform you afterwards that you are in what it refers to as a "detached head" state. Before you update your copy of the source, you should check out the master branch first:
 +
 
 +
$ git checkout master
 +
}}
 +
 
 +
To pull (i.e., fetch and merge) changes made since you checked out the source&mdash;that is, to update your working copy to match the current state of the official repository&mdash;you (typically) need only run one command:
 +
 
 +
$ git pull origin master
  
 
==Compiling==
 
==Compiling==
  
 
After getting the source code, you can [[Compiling the source|compile]] it.
 
After getting the source code, you can [[Compiling the source|compile]] it.

Latest revision as of 22:37, 30 August 2022

Information 48x48.png

Note

The recommended way to fetch the sources is to use Git to clone the repository.

The Unvanquished source code is hosted on GitHub.

Downloading a snapshot of the source code in archive form isn't tested.

Installing Git

Git is a distributed source version control system.

Git is free software and is used for everything in the contribution process: code, image, models, sound files, everything is tracked in git repositories. We also do heavy usage of git submodules. Some of our tools expect git to be present and data to actually be stored in repositories to work properly.

See Installing Git.

Downloading the source

Information 48x48.png

Note

In case this happens to become outdated, the up-to-date documentation can be found in the README.md file in source repository.

Command line

The following commands will work on any platform.

git clone --recurse-submodules https://github.com/Unvanquished/Unvanquished.git

This will create a directory called Unvanquished.

If you already cloned but forgot to use the --recurse-submodules option:

cd Unvanquished
git submodule update --init --recursive

If you would like to get the source for a particular version, check out the associated tag:

cd Unvanquished
git checkout v0.54.1

To see the list of tags (versions) available to check out,

git tag

will produce a list.

Linux

Please see the command line instructions.

macOS

Command Line

Open a Terminal (/Applications/Utilities/Terminal) and follow the command line instructions.

Xcode 4

  1. Start Xcode.
  2. Open the Organizer window (Window → Organizer or ShiftCommand ⌘2)
  3. Hit the "Repositories" button on the top bar.
  4. Hit the "+" button in the lower-left corner, and choose "Checkout or Clone Repository…".
  5. In the rollout sheet that appears, enter https://github.com/Unvanquished/Unvanquished.git into the "Location" field, and hit "Next".
  6. Enter "Unvanquished" into the "Name" field, ensure that the "Type" combo box is set to "Git", and hit "Clone".
  7. You will be prompted where to save the repository. Choose a location and hit "Clone".

Windows

TortoiseGIT

  1. Make and enter a new folder to store the source code in
  2. Right click the inside of the folder → Git Clone...
  3. In the Url textbox enter: https://github.com/Unvanquished/Unvanquished.git
  4. Hit OK.

Command Line

Open the MsysGit terminal and and follow the command line instructions.

Keeping your copy of the source up-to-date

For more information on using git, an excellent resource is the official git book, available to read online for free.

TortoiseGit

  1. Right-click somewhere in the source directory, and choose "Git Sync".
🚧️ TODO: Finish instructions.

Command-line (All platforms)

Information 48x48.png

Note

If you have checked out a particular commit or tag (e.g., v0.54.1), git will inform you afterwards that you are in what it refers to as a "detached head" state. Before you update your copy of the source, you should check out the master branch first:

$ git checkout master

To pull (i.e., fetch and merge) changes made since you checked out the source—that is, to update your working copy to match the current state of the official repository—you (typically) need only run one command:

$ git pull origin master

Compiling

After getting the source code, you can compile it.