How to use git with Roblox Studio
Roblox Studio keeps version history for places, but it's not the same as real version control for your code. Git gives you a readable history of every change, branches for experiments, and a reliable way to undo mistakes, including ones an AI made. Here's how to use git with a Roblox game.
The problem: scripts live inside the place
Git works on files. In a normal Roblox workflow your scripts only exist inside Studio, so there's nothing for git to track. The first step is getting your scripts out as real files, and keeping those files and Studio in sync.
Step 1: sync your scripts to files
RoIDE does this for you. Open a project folder, open your place in Studio, and pull: every Script, LocalScript and ModuleScript becomes a .luau file in folders that mirror your game. From then on, changes sync both ways while you work.
RoIDE only syncs scripts and the folders that hold them. Your map, models and UI stay in the place file, which is exactly what you want in git: readable text, not huge binary files.
Step 2: start a repository
In the project folder, run:
git init
git add .
git commit -m "First version of the game's scripts"
Any git tool works: the command line, VS Code's built-in source control, GitHub Desktop and so on.
Step 3: commit as you go
Commit whenever something works: a finished feature, a bug fix, a balance change. Good commit messages ("Coins now save on leave", "Fix round timer drift") become a readable changelog for your game.
Undo anything
If a change goes wrong, git brings the files back, and RoIDE syncs them to Studio. For example, to throw away uncommitted changes to one script:
git restore ServerScriptService/Rounds.server.luau
This is especially useful when working with AI: commit before asking for a big change, and roll back if you don't like the result. See using AI to write Roblox Luau.
Branches for experiments
Want to try a new combat system without breaking the current one? Make a branch:
git switch -c new-combat
Work on it, then switch back to your main branch if it doesn't pan out. When you switch branches, the files change and RoIDE syncs the difference to Studio.
Working with others
Push your repository to GitHub, GitLab or any git host, and teammates can clone it, open it as a RoIDE project and work on the same code with pull requests and reviews, like any other software team.
What stays out of git
Parts, models, terrain and UI live in the place, not in files, so keep publishing and saving your place as usual. Git covers your code; Roblox's own version history covers the rest.
Read more about coding Roblox games outside Studio on the Roblox IDE page.