When OpenCode edits files in your project, you want to know exactly what changed. Git gives you that visibility. It’s a version control system that tracks every change to every file in a project — what was added, what was removed, and when. It’s the tool software developers use to manage source code, and it’s the backbone of nearly every open-source project.
But you don’t need to be a developer or share your work with anyone to benefit from Git. Even if you only use it locally, Git gives you a complete history of your project. Every commit is a snapshot you can return to. If OpenCode makes a change you don’t like, you can revert it. You never have to worry about accidentally losing or overwriting work.
GitHub is a platform for hosting Git repositories in the cloud. It makes it easy to back up your projects, share them publicly, and collaborate with others. Together, Git and GitHub form the standard toolkit for managing code — and they work just as well for any project with files you want to track.
Get started with GitHub Desktop
The easiest way to get Git running is to install GitHub Desktop. It handles three things at once: installing Git on your machine, creating a GitHub account if you don’t have one, and authenticating the Git CLI so commands like git push work automatically.
If you already use Git from the command line, you can skip GitHub Desktop entirely — the exercise works either way.
What you’ll do
- Initialize a repository in a project folder so Git starts tracking changes
- Make commits — save snapshots of your work with a short description of what changed
- Review diffs — use GitHub Desktop or
git diffto see exactly what OpenCode changed in your files - Push to GitHub — back up your repository to the cloud, public or private
- Create a branch — try something experimental without affecting your main project
Once the basics are working, you can go further: write a .gitignore to keep clutter out of your repository, open a pull request, or explore your project’s commit history on github.com.