-
Notifications
You must be signed in to change notification settings - Fork 141
Using Git with Mapbase
Mapbase's code was specifically designed to be merged into forks of Source 2013 by using Git. This lets you merge Mapbase into an existing mod or update an existing mod already running on Mapbase quickly and easily.
This tutorial was originally written by Xenthio. (todo: Clarify stuff, explain how to fix an incompatible repo, etc.)
Download Git:
- Windows - Download and install Git for Windows.
-
Mac - type
git
in terminal, if git isn't installed already, it will prompt you to install it. Git can also be installed with Homebrew. - Linux - If it isn't installed already, install Git using your distro's Package Manager.
It may be beneficial to use a GUI for Git as well, like TortoiseGit or Sourcetree, but this tutorial will use command line instructions.
The Mapbase repository on GitHub can be forked by clicking here.
Once you've set up a repo on GitHub, open up the terminal or command prompt of your choice. Type cd
followed by the directory of your choice. (EXAMPLE: cd "E:\My Mapbase Fork"
)
Type git clone <REPO-LINK>
This clones the repo to your computer. (EXAMPLE: git clone https://github.com/xenthio/source-sdk-2013
)
A new folder will be created using the name of the repository (normally source-sdk-2013
) in the directory you navigated to with cd
. It will contain a local copy of the repository on GitHub.
Whenever you make a change, you should commit and push (upload) the change to the GitHub repo.
Do this by navigating to your repo's directory in the command line and typing:
git add path/to/file.txt
git commit -m "Change Message"
Commits the files, the message can be anything, e.g "Cleaned up code" or "Squashed some bugs", makes it easy to tell which commit changed what.
git push
When ever a Mapbase update is released, you can merge the changes into your repo. Make sure you've pushed all local commits before doing this.
Head over to the terminal, navigate to your repo's directory and type:
git fetch upstream
git checkout master
git merge upstream/master
-
Something Index
- Something special
- Something else