4 ms·
Git won't catch new files the agent is adding. To get around that you can of course always add all new files, but then you'll potentially have your repo pollute
by mhast 1y ago
Git won't catch new files the agent is adding. To get around that you can of course always add all new files, but then you'll potentially have your repo polluted with a bunch of temporary scratch files instead.
You can typically go back and edit git history. But it will require force push and breaking changes. And a few sacrifices to ensure that it doesn't make a mistake because then your repo is potentially broken.
Best way to do that is probably to have it work on branches and then squash merge those.
- fluidcruft 1y agoYou could also create a branch, save your intermediates there, and then squash merge when you are ready.
- skapadia 1y agoExactly. This is precisely what I do.
- winter_blue 1y agoYup, that's what I do. Even for personal projects, with the flurry of changes Claude/other AI assistants make, a branch makes it easier for me to compare changes. Often I have a branch with multiple commits on it, with each commit corresponding to a message in a conversation with AI on Cursor trying to get a new feature built. In the end, I can diff the branch against the main branch, and see the sum total of changes the AI agent has made. Maybe edit/improve manually on my own afterwards. And then, merge.
- fprotthetarball 1y ago> Git won't catch new files the agent is adding. Another problem I inadvertently dodged by using Jujutsu with Claude Code :) I tend to send a lone "commit" message to Claude when I think I'm in a spot I may want to return to in the future, in case the current path doesn't work out. Then Claude commits it with a decent message. It knows how to use jj well enough for most things. Then it's really easy to jj new back to a previous change and try again.
- stavros 1y agoI sometimes use jj in watcher mode and then just use the oplog to go back to wherever.
- black_knight 1y agoI always squash and reorganise the commits from aider. It is however awesome that everything is in git directly from the agent. I can’t imagine why not all these tools do this!
- jdthedisciple 1y agouhh... .gitignore solves that right?
- 0x6c6f6c 1y agoThese agents often generate randomly named files and dump them anywhere. You can end up with dozens of files added if you let it run on any problem it tries to create one-off "test / reproduction" cases. It hasn't always cleaned them up so a "git add all" approach can bring in junk, and the patterns for names aren't consistent. In fact they're often called stuff like *-test.js which looks like it could be a source OR test file.
- jdthedisciple 1y agoThat's why I wouldn't recommend "git add all", but rather use something like gitextensions [0] and visually add files or delete them, so you know what's happening in git world. [0] https://gitextensions.github.io/ https://gitextensions.github.io/