How to use git

SuperTuxKart GIT

There are three different level in which GIT can be used: either in a read-only mode, where you want to have a look at our latest developments, as a contributor who does not have write permission to our GIT repository, or as a developer who was write permission. This page describes the most important GIT commands to get everyone started.

Read-Only Access

Read-only access to have a look at our source code is actually already described on our installation page. Following these instruction will enable you to compile and run the current development version of SuperTuxKart. Though be aware that this version can be unstable!

GitHub for SuperTuxKart Contributors

If you want to contribute to SuperTuxKart, you first need a GitHub account. Go to https://github.com/ and sign up for a git hub account. The setup page from GitHub also explain some common settings that you should apply.

The next step is to fork the SuperTuxKart code repository. This process is explained on the GitHub fork page in more detail - just replace "Spoon-Knife" with supertuxkart. If you are used to another version control system, don't be scared by the fact that you are creating a 'fork'. This is a very normal procedure when using GIT.

Next thing for you is to clone your new GIT repository on your development machine. This process is also well described on the GitHub fork page, but here is an example. I started by creating a fork from supertuxkart to my GutHub account 'hiker' on the GitHub web page. On my development machine I then did: git clone git@github.com:hiker/stk-code.git stk-hiker This created a local copy of my repository (which is a copy of the supertuxkart code repository). Then I set up the connection to SuperTuxKart's main repository, so that I could easily get any additional changes from the main repository that I might need later. I call the supertuxkart repo 'upstream': git remote add upstream git@github.com:supertuxkart/stk-code.git git remote -v origin git@github.com:hiker/stk-code.git (fetch) origin git@github.com:hiker/stk-code.git (push) upstream git@github.com:supertuxkart/stk-code.git (fetch) upstream git@github.com:supertuxkart/stk-code.git (push) The last command shows which remote repositories you have defined: one, called origin, is your fork of SuperTuxKart, the one called upstream is the actual SuperTuxKart repository. The first one will be used to cooperate with other developers (or mentors). It will allow them to see your work, and help with any problems you have. Also, it will act as a backup for you: if your harddrive should get destroyed, you will have an online version still available. Additionally, it will also you to switch computers, if you should be using different computers or different operating systems. The upstream version will be used to inform the main developers of any changes that you want to be merged into STK.

To get a copy of all current developments, first do a git fetch upstream then merge the changes using git merge upstream/master After this command you will have a copy of everything that happens in the STK main repository. The master trunk in STK will be called upstream/master.

You will be doing your work on a branch (or branches). To create a branch, use:

git branch new_login git checkout new_login git branch -v master 2a66d53 Merge branch 'master' of github.com:supertuxkart/stk-code

The first two commands can be combined into one git checkout -b new_login.

Then you can use the usual git commands to add and commit files. If you want to push your changes to your repository on, do a: git push origin new_login Remember to do this regularly.

If you want to merge in any updates from the SuperTuxKart repository, use: git fetch upstream git merge upstream/master

Retrieved from "http://supertuxkart.sourceforge.net/How_to_use_git"

User Tools