Template:Obtaining The Source Code: Difference between revisions

From Spring
Jump to navigationJump to search
Gajop (talk | contribs)
Abma (talk | contribs)
Line 24: Line 24:


Just as above with a minimal change:
Just as above with a minimal change:
<code><pre>git clone --recursive git://github.com/spring/spring.git -b develop</pre></code>
{{code|git clone --recursive git://github.com/spring/spring.git -b develop}}
and update with:
and update with:
<code><pre>git pull --rebase</pre></code>
{{code|git pull --rebase}}




Note: you can switch <code>branches</code> this way:
Note: you can switch <code>branches</code> this way:
<code><pre>
{{code|
# backup your current changes
# backup your current changes
git stash
git stash
Line 49: Line 49:
#or
#or
#git stash apply --index 0  # reapplies your changes and keep the backup (see `git stash list`)
#git stash apply --index 0  # reapplies your changes and keep the backup (see `git stash list`)
</pre></code>
}}


====Submodules====
====Submodules====

Revision as of 22:35, 20 August 2018

Tarballs

(For playing online)

Using Git is the recommended way to get the sources of the engine. In spite of, you can use the official tarballs to compile Spring without git.

Note: Do NOT use the zip-files from github, they are missing important data to compile Spring.

See Building spring for build instructions.


Git

Spring project page at github (status page)

Master repo URI: git://github.com/spring/spring.git
Backup repo: git://git.code.sf.net/p/springrts/code


Latest Stable (master branch)

Assuming the GIT command line client is installed, you can clone the repository with

git clone --recursive git://github.com/spring/spring.git -b master

and update it with:

git pull --rebase

Bleeding-edge (develop branch)

This will also allow you to make a patch out of the changes you make to the code, and send it to one of the developers with repository access. If you are new to git and github, you may want to have a look at this guide to get you started.


Just as above with a minimal change: <syntaxhighlight lang="bash">git clone --recursive git://github.com/spring/spring.git -b develop </syntaxhighlight> and update with: <syntaxhighlight lang="bash">git pull --rebase </syntaxhighlight>


Note: you can switch branches this way: <syntaxhighlight lang="bash">

  1. backup your current changes

git stash

  1. switch branch

git checkout $MY_OTHER_BRANCH

  1. sometimes needed
  2. note, it deletes all your unstashed changes and all non-pushed commits on the new branch,
  3. but it doesn't delete untracked files.
  4. git reset --hard
  1. update/sync with remote repo

git pull --rebase

  1. optional
  2. git stash pop # reapplies your changes and DELETES the backup
  3. or
  4. git stash apply --index 0 # reapplies your changes and keep the backup (see `git stash list`)

</syntaxhighlight>

Submodules

To obtain the submodules you should clone the repository with --recursive as mentioned above. If you haven't done this, you can execute the following code

git submodule sync
git submodule update --init

To update the submodules, you have to execute the same commands again or pull normally.