Git Workflow With Claude Code: Commits, Branches, Pull Requests
Git Workflow With Claude Code: Commits, Branches, Pull Requests
~8 Min. Lesezeit Zuletzt aktualisiert am August 8, 2026
The recipe planner has made quite a bit of progress by now: basic structure, search, bug fix, code review, tests, categories. High time this work gets recorded in git as well - the standard version control tool, which Claude Code works with via the Bash tool from chapter 8, just like any other command-line program.
Having progress committed
Instead of typing every git command yourself, you can directly ask Claude Code to save the current state:
> Save the current state as a commit. Check git status and git diff first, and write a fitting commit message that describes what changed.Claude Code then checks with git status and git diff which files have changed, writes a fitting commit message, and creates the commit - similar to what you'd do yourself, just automated, and with a summary that actually matches the concrete content of the change, instead of a generic message like "Update".
git status
git diff
git add src/recipes.js server.js
git commit -m "Add category filter for recipes"Branches for larger changes
For a larger change - like the category feature from chapter 18 - a dedicated branch is a good idea, rather than working directly on the main branch. This too can be requested directly:
> Create a new branch "feature/categories", switch to it, and commit the category changes there.git checkout -b feature/categories
git add .
git commit -m "Add recipe categories and filter"Creating pull requests
Once the change is finished and tested, you can also turn it into a pull request - a request to merge the changes from the feature branch into the main branch, usually through a platform like GitHub or GitLab:
> Push the feature/categories branch and create a pull request with a short summary of the change and a few bullet points on how to test it.Claude Code can both run the actual git push and, if a matching command-line tool for the platform in use is installed and set up, create the pull request itself, including title and description.
Staying in control
Achtung: Git commands like git commit are usually uncritical through the Bash tool - but commands like git push --force or git reset --hard can irreversibly overwrite or delete work. Exactly as described in chapter 8: read carefully what's being proposed before approving it, even for git commands, especially anything with "force" or "hard" in the name.
Important to know: Claude Code generally doesn't create commits or pushes without your prior request or approval - git actions run through the Bash tool and are therefore subject to the same permission rules from chapter 9 as any other command.
Tipp: A good rhythm: commit after every completed, meaningful piece of work - similar to how, in this series, a new, thematically clear commit could have been made after every recipe planner chapter. Small, well-described commits are far easier to follow later than one giant commit at the end.