r/PiCodingAgent • • Sep 27 '26

Question What's your git workflow?

Hello.

I have spent a while now wrapping my head around agentic development in my spare time for a while now. And have now gotten to the point I need to get my pi agent to start using Git.

So I was wondering what are your workflows with git? what extensions, lines in AGENTS.md or external scripts etc are you using?

And what tools/programs are you using when reviewing pr's?

2 Upvotes

11 comments sorted by

2

u/Dsphar Sep 27 '26

Each role does its own git commit. Once the loop finishes, the finale role does a soft reset and a single commit, rolling all the work into one diff. I then push manually into a remote repo, never let my agent push.

1

u/lihnuz Sep 28 '26

what do you mean by role here?

1

u/Dsphar Sep 28 '26

Interviewer, planner, worker, tester, reviewer, finalizer.

1

u/WintertideFellow Sep 27 '26

Worktrees! I completely remove git from their toolset-- call me paranoid, but sending them through prescribed paths keeps everyone well behaved. 

They've got a tool to backmerge master into their worktree, a tool to diff against master, and a tool merge into master, which fails on anything but a clean merge. Githooks to pick up the obvious errors like merge markers left in. Otherwise the code writers don't touch git -- anything that would require that is above their pay grade and dealt with by management agents. 

And I don't deal with pull requests (yet). QA looks at the code in place and gives a thumbs up or down. 

1

u/lihnuz Sep 28 '26

could you share the tools you are using for working with worktrees? Something you written yourself or did you find someone else to use?

1

u/WintertideFellow Sep 28 '26

It's all custom, and not fancy at all. The git side of it are simple wrappers. The dispatcher that spins up jobs in worktrees is slightly more complicated, but exactly what you'd expect. 

I really didn't want to integrate a full-blown bug tracker, so I tried first with some markdown coordination, then git-bug, and am currently tracking everything in sqlite. Happy so far, but still in early days and don't have anything approaching a production setup. (200k log, 350 closed tasks so far)

1

u/zanar97862 Sep 28 '26

For an alternate perspective, I am a pleb and did not know solid git basics pre AI so I'm YOLOing it. 

My global agents tells them not to push without permission and I don't run enough concurrent work on the same projecy to run into many merging issues. Once the work is done and passes all the tests I tell the agent to merge straight on main. This is bad practice and only works because I'm a solo developer. The right way to do it is with work trees/branches and PRs to main that get checked and resolved.

Probably what I should learn to do next tbh, setup a proper software development pipeline and understand the bits so I don't get swamped.

1

u/[deleted] Sep 28 '26

[removed] — view removed comment

1

u/lihnuz Sep 28 '26

auto-setup script,

what do this script do?