Difference between revisions of "MG/Getting The Code"

From MegaGlest
Jump to navigation Jump to search
(Copied changes made by 80.54.236.119 <http://glest.wikia.com/wiki/MG/Getting_The_Code?curid=2198&action=history>)
Line 1: Line 1:
[[MegaGlest]] has now switched to git for managing the game's source code and data (the svn repo is no longer active). Using the command line you would get the code in one of two ways. Either read-only if you will not contribute changes or read and write if you plan to help contribute to the project as well.
+
[[MegaGlest]] has switched to git for managing the game's source code and data (the svn repo is no longer active).
  
==Choose a git client==
+
==Choose and install a git client==
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.
+
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====
+
===Linux===
Install the git tools. On Debian GNU/Linux based distributions this is as easy as
+
On Debian GNU/Linux based distributions this is as easy as:
  
 
  sudo apt-get update && sudo apt-get install git
 
  sudo apt-get update && sudo apt-get install git
  
On other distributions, the process will be quite similar but you will need to use the package management tools available there.
+
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.  
  
====Windows====
+
===Windows===
Download [http://git-scm.com/ Git] and install it, 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, [http://code.google.com/p/tortoisegit/ TortoiseGit] exists for that, though you will still need to install Git as well as [http://code.google.com/p/msysgit/ MysisGit].
+
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.
  
 
==Check out the source code==
 
==Check out the source code==
 
===Cloning the sources===
 
===Cloning the sources===
:'''''Prior to running these commands, you need to navigate to the directory (folder) you wish to place the MegaGlest source in.'''''
+
'''''Prior to running these commands, you need to navigate to the directory (folder) you wish to place the MegaGlest source directory in.'''''
 +
 
 +
git clone --recursive <nowiki>https://github.com/MegaGlest/megaglest-source.git</nowiki>
 +
 
 +
===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
 +
git submodule update --init --recursive
 +
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]].
  
git clone --recursive https://github.com/MegaGlest/megaglest-source.git
+
===After the cloning===
  cd megaglest-source/data/glest_game
+
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.
  git checkout master
+
  cd megaglest-source
 +
cd data/glest_game
 +
  git checkout <branch>
 
  cd ../..
 
  cd ../..
  
:*If you've made a quite popular mistake - "cloned repository without data (submodules)", then you should do this:
+
==Update the source code==
  >    git submodule update --init --recursive
+
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.
>    cd data/glest_game
+
 
>    git checkout master
+
First choose the branch, e.g. "develop":
>    cd ../..
+
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==
This will check out the '''master''' source code and data directories, which is where active development takes place in. Each release is 'tagged' and resides as '''tags''', so if you wanted an older release you would check out something below instead. Check [https://megaglest.svn.sourceforge.net/svnroot/megaglest/tags/ here] to see which ones are available.
+
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 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.
+
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.
  
 
==See also==
 
==See also==
 
*[[MG/Project Structure|Project Structure]]
 
*[[MG/Project Structure|Project Structure]]
 +
*[https://github.com/MegaGlest/megaglest-source/wiki/Git-How-To Git-How-To]

Revision as of 22:41, 22 June 2014

MegaGlest has switched to git for managing the game's source code and data (the svn repo is no longer active).

Choose and install a git client

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

On Debian GNU/Linux based distributions this is as easy as:

sudo apt-get update && sudo apt-get install git

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.

Windows

Download >>GIT<< and install it (Important: On install-options choose "Run Git from Windows Command Prompt".), then run git-bash.bat 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. TortoiseGit exists for that.

Check out the source code

Cloning the sources

Prior to running these commands, you need to navigate to the directory (folder) you wish to place the MegaGlest source directory in.

git clone --recursive https://github.com/MegaGlest/megaglest-source.git

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
git submodule update --init --recursive

If you still are not sure that you have downloaded full working source then you can compare your source directory with the Project Structure.

After the cloning

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.

cd megaglest-source
cd data/glest_game
git checkout <branch>
cd ../..

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 advanced git tutorial intended for developers.

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 here to see which ones are available.

Branches are created for separate larger changes from active / stable development, so check with your web browser which ones are available if this is your intention.

See also