Dev.to · 8 min read

Git-Native AI Development: Every Action is a Commit

Git-Native AI Development: Every Action is a Commit

Originally published at getorquesta.com/blog/git-native-ai-development-every-action-is-a-commit-2026-11-07 The Problem with AI-Generated Code When we first started building Orquesta, we knew that letting AI agents write code on behalf of developers would raise a lot of eyebrows. The obvious questions: "How do I know what the AI changed?" "Can I roll back if it breaks something?" "Who is responsible when the AI makes a mistake?" These aren't theoretical concerns. In early experiments, we ran AI agents that modified files directly in a working directory. The agent would make a series of changes—create a file, edit a function, update dependencies—and then we'd be left with a pile of modifications. The AI's output was there, but the history was lost. We had logs, sure, but logs aren't code. They don't show you the diff at each step. They don't let you revert a single change without reverting everything else. That's when we realized: the only way to make AI-generated code truly manageable is to make every single action a real git commit. Git as the Source of Truth Git is already the universal tool for tracking changes in software. Developers understand commits, diffs, branches, and reverts. When AI writes code, forcing it to operate within the same paradigm means you get all the benefits of git for free: blame, bisect, cherry-pick, revert, and an immutable audit trail. But most AI coding tools don't do this. They either apply changes to your working tree and let you commit everything at the end (losing the intermediate steps), or they run in a cloud sandbox where the git history is separate from your main repository. That's a massive gap. In Orquesta, we made a fundamental design decision: the AI agent runs locally on your machine, and every time the agent performs an action—running a command, creating a file, modifying a function—that action is immediately committed to git. Not staged, not left as a diff, but committed with a proper commit message, author, and timestamp. This is what we call git-native AI development. How It Works in Orquesta When you submit a prompt through Orquesta, the agent starts working in a dedicated branch (or your current branch, depending on configuration). Each step in the agent's process becomes a commit. For example, if the agent needs to: Create a new file src/utils/parser.js Modify src/index.js to import and use the parser Update package.json to add a dependency Run tests and fix a failing test Each of these actions results in a separate git commit. The commit message is generated by the agent, explaining what it did and why. The author is the human who submitted the prompt, and we add a co-author trailer for the AI model and version. Here's what a typical git log might look like after an Orquesta agent run: commit 9f2a1c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b Author: Jane Developer Date: Tue Oct 24 14:32:11 2023 +0200 Add parser utility for JSON schema validation Co-authored-by: Claude 3.5 Sonnet commit 7b6c5d4e3f2a1b0c9d8e7f6a5b4c3d2e1f0a9b8c7d Author: Jane Developer Date: Tue Oct 24 14:31:58 2023 +0200 Import parser in index.js and use for config loading Co-authored-by: Claude 3.5 Sonnet commit 5d4c3b2a1f0e9d8c7b6a5f4e3d2c1b0a9f8e7d6c5b4 Author: Jane Developer Date: Tue Oct 24 14:31:42 2023 +0200 Add ajv dependency for schema validation Co-authored-by: Claude 3.5 Sonnet Every commit is a real, immutable record. You can inspect the diff, cherry-pick it, revert it, or use git bisect to find when a bug was introduced. Because the agent runs locally, these commits live in your repository like any other commit. No special tooling required. Why This Matters: Accountability When AI writes code, the question of accountability becomes critical. Who is responsible when the AI introduces a vulnerability or a logic error? With git-native commits, the answer is clear: the human who submitted the prompt is the author. They are the one who initiated the action, even if the AI did the actual writing. We include the AI model as a co-author to provide full transparency about which model and version generated the change. This is important for compliance and auditing. If you're in a regulated industry, you can show exactly what changed, when, and who initiated it. Your git history becomes a legal record. Beyond that, it changes team dynamics. A developer can review a series of commits from an AI agent just like they would review commits from a colleague. They can comment on specific changes, ask for modifications, and approve or reject. In Orquesta, this ties into our quality gates: a team lead can review the AI's commits in a pull request before they are merged to the main branch. Since each commit is granular, the review is easier and more precise. Rollback Without Fear One of the biggest fears with AI-generated code is that it will break something and you won't be able to fix it quickly. With every action a commit, rollback is trivial. If the AI made ten changes and the third one caused a regression, you can revert just that commit. You don't have to undo all the AI's work. In traditional AI coding tools, you might have to manually undo changes or revert to a previous snapshot, losing the good changes along with the bad. With git-native commits, you get surgical rollback. This is especially powerful when the agent runs for a long time and makes dozens of changes. You can isolate the problematic change and keep the rest. Comparing with Non-Git-Native Approaches Let's be honest: many AI coding assistants are not git-native. They operate on your working tree, and you might not commit until you're satisfied. That means if you want to see the intermediate steps, you're out of luck. Some tools provide a "history" feature that shows the AI's actions, but that's not the same as git history. It's not integrated with your repository, and you can't use standard git commands to interact with it. Cloud-based AI agents are even worse. They run in a sandbox, and while they might produce a final diff, the internal steps are opaque. You can't see the sequence of changes, and you can't roll back to an intermediate state. You're trusting the vendor's log, not your own git history. Git-native development puts the control back in your hands. Your repository is the single source of truth. The AI's actions are just commits. Real-World Scenario: Refactoring Gone Wrong Imagine you ask an AI agent to refactor a payment processing module. The agent makes 30 commits: renaming variables, extracting functions, updating tests, and so on. After the agent finishes, you run the full test suite and find that a particular edge case now fails. With git-native commits, you can run git bisect to automatically find the commit that introduced the failure. Because each commit is a small, logical step, the bisect will pinpoint the exact change that broke the test. You can then revert that commit or ask the agent to fix it specifically. Without git-native commits, you'd have to manually review a massive diff, guess which part of the refactoring caused the issue, and potentially lose hours. The difference in productivity is staggering. Beyond Commits: The Full Audit Trail While git commits are the backbone, Orquesta also records everything else: the original prompt, the agent's reasoning (via Batuta's Think-Act-Observe loop), the full terminal output, and the cost. All of this is tied to the commits. So when you look at a commit, you can see the prompt that led to it, the AI's thought process, and the exact command that was run. This creates an unprecedented level of traceability. For each line of code changed by AI, you can answer: Who asked for it? What was the AI trying to do? What was the context? That's essential for debugging, onboarding, and compliance. Conclusion The shift to AI-assisted development is inevitable, but we can't sacrifice the rigor that git provides. By making every AI action a real git commit, we preserve the core values of software engineering: accountability, transparency, and the ability to roll back. It's not just about having a log; it's about keeping the AI's work within the same system of record that developers have used for decades. In Orquesta, we've built this from the ground up. Every action is a commit. And that changes everything about how you can trust AI in your codebase. Takeaway: If you're evaluating AI coding tools, ask one question: "Does every action become a git commit?" If the answer is no, you're giving up control.

This is a summary aggregated from Dev.to. Read the complete article on the original site:

Read full article at Dev.to

More AI & Machine Learning News