Game Development Reference
In-Depth Information
not surprising that the main developer of Linux, Linus Torvalds, is also the main
developer of Git.
Even if you don't plan on forking a project, a clone of the repository still has the
advantagethatanyoperationsyouperformwillactuallybeonyourlocalclone,not
on the central repository. This means that actions such as committing files will be
faster, and you don't necessarily have to be connected to a network to commit. But
it also means that when you commit file changes, they will not automatically com-
mit to the central server. To solve this, Git does provide functionality to “push”
your commits from your local clone to the central repository and likewise “pull”
changes from the central repository to the local one.
But if all you really want is just a central repository on a local network (as might
happen in a professional environment), there may not really be much advantage to
using Git. It has the additional overhead of needing to synchronize with the server,
which if you're going to want to do anyway, you might as well use a system that's
designed for that purpose.
Using Git
The source code for the games implemented in Chapters 13 and 14 is hosted on
GitHub ( http://github.com ) , which is the most popular site for hosting open source
Git projects. Although you can use several different clients for Git, the easiest way
to clone repositories from GitHub is to use the GitHub client. There are both Win-
dows and Mac versions of the client, which both work roughly in the same way.
First, in order to use the GitHub client, you will need to create a GitHub account.
This can just be done on the home page of their website. Once you have created
an account, you can install the GitHub client for either Windows ( ht-
tp://windows.github.com ) or Mac ( http://mac.github.com ) . When you fire up the
client for the first time, it'll ask you for the account user name and password you
just created.
Once the client is set up, you're ready to use GitHub. Go to the web page for
a GitHub repository you want to clone (for example, https://github.com/gameal-
gorithms/defense for the tower defense game in Chapter 14 ) . Once you're on the
page, on the right side you should see a button labeled either “Clone in Desktop”
or “Clone in Mac.” If you click that button, the Git clone procedure will kick off in
the GitHub client. If this procedure worked properly, the project should be added
to your list of repositories in the client.
Search WWH ::




Custom Search