Engineering
Using Git to manage FiveM resources
Put a FiveM server or script under Git: what to commit and what to ignore, a .gitignore for server-data, keeping licence keys and tokens out of the repo, large streamed assets and Git LFS, branches for testing, private GitHub repos, and deploying with git pull.
Overview
“Who changed the garage config?” and “it worked yesterday” stop being mysteries once your server is in Git. Every change has an author, a date and a message, broken edits can be undone in seconds, and a test server can run a branch before it reaches players.
01Setting up the repository
git init
git add .
git commit -m "Initial server state"
git branch -M main
git remote add origin [email protected]:you/your-server.git
git push -u origin mainWhat to ignore
# FXServer generated
cache/
*.log
# txAdmin data
txData/
# secrets
secrets.cfg
*.env
# node / build output of NUI projects
node_modules/
web/dist/
# OS junk
Thumbs.db
.DS_StoreWhether to commit NUI build output depends on your deploy: if the server does not build, commit the built files and ignore only node_modules.
Keeping secrets out
exec secrets.cfg
ensure oxmysql
ensure ox_libsv_licenseKey "..."
set mysql_connection_string "mysql://fivem:...@localhost/fivem"
set discord_bot_token "..."Large streamed assets
Vehicle and map packs can be gigabytes. GitHub warns on files over 50 MB and blocks files over 100 MB. Use Git LFS for large binary assets, or keep asset packs in a separate storage and only version scripts and configs.
A simple workflow
- Create a branch for a change:
git switch -c garage-rework. - Test it on a local or test server — see local development server.
- Commit with a clear message, merge into
main. - On the live server:
git pull, thenensureor restart the changed resources.
Paid and escrowed resources
Purchased resources are licensed to you; putting them in a public repository redistributes them. Keep server repos private, and never publish escrowed files — see asset escrow explained.
Frequently asked questions
Should I put my FiveM server in Git?
Yes — at least resources and configs. It gives you history, undo and safe deploys.
What should a FiveM .gitignore contain?
cache/, logs, txData/, secret files, node_modules/ and build output you do not deploy.
How do I keep my license key out of GitHub?
Put it in a secrets.cfg that server.cfg execs, and add that file to .gitignore.
Can I push large vehicle packs to GitHub?
Files over 100 MB are blocked. Use Git LFS or store large assets elsewhere.
Need this built, not just explained?
Ten years of FiveM work, from Lua to NUI
Custom resources, React NUI, ESX / QBCore / Qbox integration, OneSync performance audits and security reviews — plus the websites and SEO around your server brand.
Related guides
- Getting startedRunning a local FiveM server for developmentRun FXServer on your PC (txAdmin or vanilla), point it at a copy of your server-data and a separate development database, and connect from FiveM with connect localhost:30120. sv_lan true makes the server LAN-only and skips the licence key check. Use ensure <resource> after edits and refresh for new resources, keep game build and OneSync settings identical to production, and test multiplayer logic with a second account or machine.
- Getting startedSetting up VS Code for FiveM scriptingInstall the Lua extension (Lua Language Server by sumneko/LuaLS). Clone Overextended’s fivem-lls-addon — the replacement for the discontinued CfxLua IntelliSense extension — into a folder for Lua addons, point workspace.userThirdParty at that folder in a .luarc.json, and add ox_lib to workspace.library. For JavaScript/TypeScript, install @citizenfx/client and @citizenfx/server typings.
- BusinessAsset escrow: protecting and buying FiveM resourcesAsset escrow encrypts Lua, YFT, YDD and YDR files uploaded to the Cfx.re Portal and delivers them through Tebex. An escrowed resource only starts on servers whose owner holds the entitlement; otherwise the console shows “You lack the required entitlement”. Sellers leave config files editable with escrow_ignore. NUI files are not encrypted. Re-uploading replaces the version on the seller’s account, and subscription assets stop working when the subscription ends.