Editing MG/Getting The Code

Jump to navigation Jump to search

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.

Latest revision Your text
Line 1: Line 1:
[[MegaGlest]] has switched to git for managing the game's source code and data (the svn repo is no longer active).
+
==Choose a subversion client==
  
==Linux quick setup==
+
For source code management, i.e. software versioning and revision control, we use the [http://en.wikipedia.org/wiki/Apache_Subversion subversion system]. You need to install a subversion client on your computer to access and work with it properly.
Do this ( download size is ~600MB ):
 
  
sudo apt-get update && sudo apt-get -y install git
+
====Linux====
git clone --recurse-submodules https://github.com/MegaGlest/megaglest-source.git
 
cd megaglest-source/mk/linux/
 
sudo ./setupBuildDeps.sh
 
./build-mg.sh
 
  
launch with:
+
Most users will want to use the [https://subversion.apache.org/ Apache Software Foundation (ASF) subversion] command line interface (CLI), as provided, on most distributions, by the 'subversion' package. Many distributions also provide graphical interfaces which are either frontends to the ASF subversion CLI or are standalone.
./megaglest
 
  
==Choose and install a git client==
+
====Windows====
The MegaGlest source is stored in a Git repository (versions prior to 3.9.0 are in a different - SVN repository, however), and requires a Git client to download. Clients exist for all major operating systems.
 
  
===Linux===
+
If you fancy graphical interfaces then [http://tortoisesvn.tigris.org/ Tortoise] is for you. It allows you to manage the subversion repository from within Windows Explorer. However, if you prefer to work on a command line, then [http://www.sliksvn.com/en/download/ SlikSVN] is the utility you want.
On Debian GNU/Linux based distributions this is as easy as:
 
  
sudo apt-get update && sudo apt-get install git
+
Windows 7 note: If you are going to use subversion on 64-bit Windows 7 and get error messages like ''The file or directory is corrupted and unreadable'' then that's because your OS's only primary file system [http://glest.org/glest_board/?topic=5611.msg58480#msg58480 is buggy].
  
On other distributions, the process will be quite similar but you will need to use the package management tools available there and you should look for "git" or "git-core" package.
+
==Check out the source code==
  
===Windows===
+
*NOTE: We have now switched to git (the svn repo is no longer active). Using the command line you would get the code in one of two way a) read-only if you will not contribute changes back b) read-write if you plan to help contribute to the project:
Download [http://git-scm.com/download/win >>GIT<<] and install it ('''Important: '''On install-options choose "Run Git from Windows Command Prompt".), then run <tt>git-bash.bat</tt> in the installation folder to start the Git command line.
 
  
For those with a preference for a client with a graphical interface, then e.g. [http://code.google.com/p/tortoisegit/ TortoiseGit] exists for that.
+
mkdir megaglest-git
 +
cd megaglest-git
  
==Check out the source code==
+
a) readonly
===Cloning the sources===
+
git clone git://megaglest.git.sourceforge.net/gitroot/megaglest/megaglest /megaglest-source
'''''Prior to running these commands, you need to navigate to the directory (folder) you wish to place the MegaGlest source directory in.'''''
+
git clone git://megaglest.git.sourceforge.net/gitroot/megaglest/megaglest /megaglest-data
 +
git clone git://megaglest.git.sourceforge.net/gitroot/megaglest/megaglest /megaglest-data-source
  
  git clone --recurse-submodules <nowiki>https://github.com/MegaGlest/megaglest-source.git</nowiki>
+
b) read-write
 +
  git clone ssh://<sourceforge- username>@megaglest.git.sourceforge.net/gitroot/megaglest/megaglest-source
 +
git clone ssh://<sourceforge- username>@megaglest.git.sourceforge.net/gitroot/megaglest/megaglest-data
 +
git clone ssh://<sourceforge- username>@megaglest.git.sourceforge.net/gitroot/megaglest/megaglest-data-source
  
===Popular mistakes===
 
If you've not read this guide before clone then you probably made a quite popular mistake - "cloned repository without data (submodules)", then you should do this:
 
 
  cd megaglest-source
 
  cd megaglest-source
  git submodule update --init --recursive
+
  ln -s -T ../megaglest-data data
If you still are not sure that you have downloaded full working source then you can compare your source directory with the [[MG/Project Structure|Project Structure]].
+
 
 +
This section is now deprecated, but will work for version 3.6.0.2 and lower
  
===After the cloning===
+
If you chose a subversion CLI then run the following command to retrieve the latest source code:
If you want start work on changes in data submodule (or any other) then '''before starting''' you should first checkout HEAD of desirable branch e.g. "develop". In most situations it does not apply to regular users/testers/gamers.
+
svn co https://megaglest.svn.sourceforge.net/svnroot/megaglest/trunk megaglest
cd megaglest-source
+
 
cd data/glest_game
+
==Project folder layout==
git checkout <branch>
+
 
cd ../..
+
[[File:Folder_structure.png]]
  
==Update the source code==
 
When some time has elapsed after the "clone" and you again want to test the HEAD of the game then you should update the source code.
 
  
First choose the branch, e.g. "develop":
 
git checkout <branch>
 
If you’re not actively working on the source and submodules (you are a tester/gamer), then the simplest and most universal way to update is:
 
git pull && git submodule update --init --recursive
 
in the other case you should read more [https://github.com/MegaGlest/megaglest-source/wiki/Git-How-To advanced git tutorial] intended for developers.
 
  
 
==Tags and branches==
 
==Tags and branches==
Each release is 'tagged' and resides as '''tags''', so if you wanted an older release you would check out something below instead. Check [https://github.com/MegaGlest/megaglest-source/releases here] to see which ones are available.
 
  
Branches are created for separate larger changes from active / stable development, so check with your [https://github.com/MegaGlest/megaglest-source/branches web browser] which ones are available if this is your intention.
+
This will check out the '''trunk''' directory, which is where active development takes place in. Each release is 'tagged' and a copy resides in the '''tags''' directory, so if you wanted an older release you would check out something below
 +
https://megaglest.svn.sourceforge.net/svnroot/megaglest/tags/
 +
 
 +
instead. Just use your web browser to click on this URL and see which ones are available.
  
==See also==
+
Branches are created in the '''branches''' subdirectory when required to seperate larger changes from active / stable development, so replace 'trunk' by 'branches' and check with your web brower which ones are available if this is your intention.
*[[MG/Project Structure|Project Structure]]
 
*[https://github.com/MegaGlest/megaglest-source/wiki/Git-How-To Git-How-To]
 
  
 +
More info about the SVN Structure: [[MG/SVN Structure|SVN Structure]]
 
[[Category:MG]]
 
[[Category:MG]]
[[Category:Development]]
 

Please note that all contributions to MegaGlest are considered to be released under the Creative Commons Attribution Share Alike (see MegaGlest:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!

To edit this page, please answer the question that appears below (more info):

Cancel Editing help (opens in new window)