Rebase and Sync fork with OpenRCT2
There will be times where your Pull Request will have merge conflicts and the pending rebase label. This means that your changes conflict with what is on the main OpenRCT2 repository, and the diff cannot be applied cleanly. This happens because someone changed the vicinity or the actual same code that you were tinkering with and now git doesn't know which version to keep. This might have been caused by two things:
- Your fork is fairly old and the file has changed dramatically since then.
- Your fork was synced, but some other Pull Request that altered the same file was merged before yours, and now it conflicts.
There are two ways of solving merge conflicts: the first is to always have your repository synced when you start something, but that won't always prevent it, so the second is solving the issue itself.
Sync fork with main OpenRCT2 repository
It is very simple to sync with the OpenRCT2 repository, as long as you never push things onto your forks develop branch. You should do it, ideally, every time you're about to start a new branch or when you need to solve merge conflicts. To do so:
git checkout developgit pull upstream develop --rebasegit push
That's it, now your fork's develop is the same as OpenRCT2's develop.
Solve merge conflicts
Eventually, even if you try to keep the fork as synced as possible, you'll have merge conflicts, it happens. To solve them, you have to first sync your develop branch, as shown above, and then rebase your other branch onto the recently synced develop.
Note: We do want rebase and not merge, as the latter creates a messy and hard to review PR. GitHub tutorials and tools sadly encourage merge, so take care when acting.
To solve the merge conflicts:
- Sync your develop branch, as shown above.
git checkout your-branchgit rebase develop: This will eventually print "merge conflict..." messages which will require you to open each file listed and solve the conflictsgit add -u: Once you are sure the conflicts pointed out have been solved. You can search the repository for<<<<to be sure.git rebase --continue: To continue the rebase.git push -f origin: Once the rebase is done and successful, push your rebased branch to GitHub.
- Home
- FAQ & Common Issues
- Roadmap
- Installation
- Building
- Features
- Development
- Benchmarking & stress testing OpenRCT2
- Coding Style
- Commit Messages
- Overall program structure
- Data Structures
- CSS1.DAT
- Custom Music and Ride Music Objects
- Game Actions
- G1 Elements Layout
- game.cfg structure
- Maps
- Music Cleanup
- Objects
- Official extended scenery set
- Peep AI
- Peep Sprite Type
- RCT1 ride and vehicle types and their RCT2 equivalents
- RCT12_MAX_SOMETHING versus MAX_SOMETHING
- Ride rating calculation
- SV6 Ride Structure
- Settings in config.ini
- Sizes and angles in the game world
- Sprite List csg1.dat
- Sprite List g1.dat
- Strings used in RCT1
- Strings used in the game
- TD6 format
- Terminology
- Track Data
- Track Designs
- Track drawers, RTDs and vehicle types
- Track types
- Vehicle Sprite Layout
- Widget colours
- Debugging OpenRCT2 on macOS
- OpenGL renderer
- Rebase and Sync fork with OpenRCT2
- Release Checklist
- Replay System
- Using minidumps from crash reports
- Using Track Block Get Previous
- History
- Testing