Review and stage changes
- Open a Code session in a Git repository.
- Choose Add a panel → Git and inspect the Current branch.
- Select changed files to review their diffs.
- Use Stage for files that belong in the commit and Unstage for files that do not. Review the staged count and scope before continuing.
- Enter a Commit message. If you use Generate commit message, read and edit the generated text.
The Git panel can contain changes from you, an agent, or another process. Staging is a repository operation, not a filter that proves authorship. A non-Git folder displays Not a git repository.
Choose the commit action
| Action | Intended effect |
|---|---|
| Commit | Create a local commit |
| Commit (Amend) | Amend the latest commit |
| Commit & Push | Commit and send work to a remote |
| Commit & Sync | Commit and run the sync action |
| Commit & Create Pull Request | Commit and begin the pull-request flow |
Choose the exact action you intend. Amend changes existing commit history; push, sync, and pull-request operations affect remote work. The action menu is not a guarantee that credentials, branch state, or remote policies allow completion.
Check the outcome
Use Refresh Git after the operation and inspect the branch, staged/unstaged files, and recent commit graph. If remote access fails, check Git authentication and the remote before repeating the action. Preserve unstaged changes rather than resetting the repository to remove an error.
Configure the model for generated messages under Settings → Preferences → AI commit messages. Continue with pull requests, worktrees, and workspace recovery.