Git
Git is a free version control program: it keeps a project's complete history as a series of saves called commits, which you can go back to at any time. It lets you work on separate versions (branches) and merge them. Claude Code uses git directly from the terminal: it can make commits, create branches, search the history and resolve conflicts.
A program that keeps the project’s history: every save (commit) stays and you can go back to it. Like the saves in a game.
How it shows up in Claude Code
The official documentation puts it simply: with Claude Code, git operations become a conversation. You don't need to memorise the commands; you tell Claude what you want, and it runs git status, git log, git commit and so on, asking for your permission when needed.
Claude Code also has its own “undo button”, /rewind, which reverts the changes it made in the current session. The documentation is clear that it doesn't replace git: rewind doesn't track files changed through terminal commands, and it's meant for quick recovery, not long-term history. That's what git is for. Git is also what worktrees are built on, letting you run several Claude sessions side by side.
Example
In the middle of a session, you can type:
what files have I changed since the last commit?
commit my changes with a descriptive message
show me the last 5 commits
Claude runs the right git commands and explains the result in plain words.
Common mistakes
- Working for hours without a single commit. If something breaks, there's nothing to go back to.
- Relying only on
/rewind. Whatever Claude changed through terminal commands (deleting or moving files) can't be undone from rewind. - Putting files with passwords, like
.env, into git. They end up in the history and stay there even if you delete them later. That's what.gitignoreis for.
Related terms and where you learn it
The basic words of git are commit, branch and repository. On GitHub, changes reach the project through a pull request, and ignored files are listed in .gitignore.
You use it with Claude in the lesson “8. How do you use Claude with git?”, in module 04 · The working method, step by step.
How it appears in the course
Git is a program that keeps the project’s history, like an album with photos of every version.
What are the four basic steps? · Module 04, The working method, step by step
A conflict appears when you and a colleague have changed the same spot in the same file. Git doesn’t know which version to keep, and it asks you.
How do you use Claude with git? · Module 04, The working method, step by step
Later on, Codex will sometimes ask for extra programs, such as Git (the program that keeps save points, you’ll meet it in module 04). You install them then, with its help.
How do you install the app on Windows? · Module 01, Installation and your first project · free
Learn Claude Code from zero, in plain English
12 modules with 1–2 minute lessons, which you can also do on your phone. The first two modules are free.