If you find a problem with the game you can report it to our development team. If you are unsure of the source of the problem, feel free to discuss the problem on our development/support IRC channel at #bzflag on the irc.libera.chat network or on our public forums. Otherwise, you can post the issue to our BZFlag project issue tracker on GitHub. There are also separate repositories and issue trackers for the other related projects such as our websites. You will find all our official projects at our GitHub organization page.
With Git and GitHub, contributing to a project is reasonably easy, but we'll try to walk you through best practices. This will allow you to work on multiple independent changes at the same time, keeping them in separate "topic branches". The example below assumes you want to contribute to the master branch and creates a new topic branch called feature/betterui in your fork.
- You will need to fork our GitHub repository the first time you want to contribute changes. You can use this same fork for later changes. Sign in to your GitHub account, go to our GitHub repository, and click the Fork button.
- Now that you have a fork of our code, you need to clone it to your computer so you can work on it. Run:
git clone https://github.com/Your_User_Name/bzflag
- You will be working from within the
bzflagdirectory from now on. Run:
- In order to later merge changes from our official repository, add an upstream remote:
git remote add upstream https://github.com/BZFlag-Dev/bzflag
- Next, check out the upstream branch you are intending to submit changes to.
git checkout master
- Do not work directly in the branches that the official repository has created (such as 2.4 or master). Instead, create your own topic branch that describes the change you are trying to make. For instance, if you were trying to add an improved user interface, your branch could be called feature/betterui. Create and checkout that new branch with:
git checkout -b feature/betterui
- Now make changes to files and then
git add FilesYouModifiedto stage the changes.
- Once you have some changes staged, you can commit those changes to your local clone. An editor will appear where you can write a message that describes the changes you have made.
- Once you have one or more commits applied to your branch, you can push these changes back up to your fork on GitHub.
git push -u origin feature/betterui
- You can repeat the process of editing files, committing, and pushing until you are ready to submit your changes back to the official repository. For this, you would create a pull request (known as a PR) on GitHub. After creating a pull request, you can continue to push new changes to your branch and this will update the changes on the PR. GitHub provides a page that talks about pull requests.
Keeping your fork in sync
As new changes are pushed to the official BZFlag project repositories, your fork will become outdated. The steps below will allow you to update your fork and bring in any new changes. The branches master and feature/betterui below are examples, with feature/betterui being a branch off of master. If you are working with another base branch, such as 2.4, or you want to update multiple branches in your fork, adjust as necessary.
- Checkout the branch name matching the upstream branch you would like to update
git checkout master
- Fetch upstream changes
git fetch upstream
- Merge upstream changes into your fork
git merge --ff-only upstream/master
- Push new changes to your fork
git push origin master
- Checkout your branch you wish to merge changes into
git checkout feature/betterui
- Rebase your branch against the branch it is based on
git rebase master
- If there are any conflicts, you must resolve those.
- Push the rebased branch
git push --force origin feature/betterui
GitHub has some documentation and guides for forking GitHub repositories:
There are various sites with tutorials and information about using Git:
There's also an online interactive site called Learn Git Branching.
This content is maintained on GitHub. We welcome any feedback and improvements!