From localhost to VPS with Git
Editing files straight on a live server is how beginners take their server down at 2am with no way back. The professional loop is different: you code on your PC, you commit when it works, you push, and the VPS pulls a known-good version. Git is the time machine that lets you roll back the moment a deploy breaks. This lesson wires that loop end to end for one resource.
Build it
Add a .gitignore before the first commit
Open your resource folder in VS Code and create a file named .gitignore at its root. List anything that holds a secret or is machine-specific:
# secrets and machine-specific files, never committed
*.env
.env
license-key.txt
db-creds.txt
config.secret.lua
node_modules/
Keep real config out of code. Instead of writing a key into a committed file, set it as a convar in (which lives on the server and is never in the repo) and read it at runtime. The convars lesson goes deep on this, but here is the shape so the secrets claim is not hand-waved: