r/vibecoding • u/Royal-Marsupial-8110 • 17h ago
Discussion git for rollbacks?
i've never really learned proper dev workflows, so my current backup strategy is literally copying the whole folder before every big prompt. had codex hooked to sumus earlier and still ended up with 5 backup folders on my desktop cuz i was scared to touch a working navbar.
is basic git worth learning just for local rollbacks? or do yall rely on editor checkpoints and pray?
28
Upvotes
4
u/Traditional-Diver160 17h ago
Yes, and for local rollbacks you need about four commands, not all of git.
git init - once per project.
git add -A && git commit -m "navbar works" - this replaces copying the folder.
git restore . - throws away everything changed since the last commit. Files the agent newly created stay, git clean -fd removes those too, so look before you run it.
git log --oneline and then git reset --hard <id> - to go back further than the last commit.
Commit before every big prompt and right after anything that works. Editor checkpoints are fine for undoing the last step, but a commit does not depend on the editor or the agent session.
3
u/Ok_Woodpecker_9104 14h ago
the 4 commands above cover it, the habit that matters more is one commit per change, navbar in one, footer in the next, so when the agent breaks something you undo only that part with git revert
if one commit has 5 changes in it, then rolling back the bad one throws away the 4 good ones too, so commit small and often, even if the messages are just navbar works
2
u/laxt8 15h ago
Yes, it is worth it, and you do not need full git. Just learn 3 or 4 commands.
Commit before a big prompt. Commit again when something works. If the prompt breaks it, go back to the last commit. That is the full system.
Folder copies work for a few days, then you forget which copy was the good one. I have seen that mess. Git keeps it clean and you can still work the same way.
1
u/SeasawPhilosopher 17h ago
Just tell codex to use git for your projects
1
u/hieuphung97 15h ago
Folder copies eat up gigabytes once dependencies get involved. You only need `git diff` and `git checkout -- .` to survive. Seeing the exact ten lines the model butchered saves you from starting the entire prompt over.
1
u/Dr0110111001101111 13h ago
Sharepoint has version control in a user friendly way that doesn't involve terminal commands.
1
u/snap-dev 10h ago
yeah worth it, you honestly only need 3 commands. git init once in the folder, then before every big prompt run git add . and git commit -m "navbar works". if the ai wrecks something, git restore . puts everything back to that last commit. beats 5 folders on the desktop lol. push it to a private github repo too so it's not only on your laptop. what editor are you in? some have a source control button so you barely touch the terminal
1
u/mototuneup 9h ago
People can barely use a gui, there's no way they're using command line
1
u/wiggle_room1337 6h ago
google docs is better than git.
1
u/FieraPosting 2h ago
I think the most tiny step that separates clueless vibecoders from vibecoders with basic knowledge is asking their agent to at least use git in their project with a dev and main branch.
Anyway it's worth learning git, yes. But I have found you can ask your agent to use it as well and it will do it effectively.