Docs › Using the editor › Git: commit messages, branch review and conflicts

Git: commit messages, branch review and conflicts

Write a commit message from what you staged, review your branch before you open a pull request, resolve merge conflicts in the chat, and mark the agent's commits.

On this page

AstraCode uses the editor's built-in Git support and adds four things to it. None of them commits or pushes for you: you stay in charge of history.

Write Commit Message

Writes a commit message for what you have staged, in the style of your repository's recent history.

  1. Stage the changes you want to commit, in the Source Control view.
  2. Choose the Write Commit Message button in the commit message box, or run AstraCode: Write Commit Message.
  3. The view shows Writing a commit message, then the message appears in the box. It replaces whatever was there; Cmd+Z (Ctrl+Z) brings your text back.
  4. Edit it if you like, and commit as usual.
MessageWhat to do
Nothing is staged. Stage the changes you want to commit first.Stage something, then try again.
No git repository is open, or the built-in Git extension is disabled.Open a folder that is a git repository, or turn the Git extension back on.
Sign in to AstraCode to write commit messages.Run AstraCode: Sign In.
Could not write a commit message: followed by a reasonThe reason says why. Report this sends a report.

Review This Branch

Reviews everything on your branch since it left the main line, before anyone else has to. Findings arrive while the code is still in front of you.

  1. Choose Review This Branch in the Source Control view's title bar, or run AstraCode: Review This Branch.
  2. With several folders open, the review is of the repository holding the file you are in. With no file open, it asks Which folder?
  3. A review runs in the chat, titled Review this branch against <base>, so you can follow what it reads.
  4. Findings land in the Problems panel, from AstraCode review, on the lines they are about. Serious ones are warnings; the rest are information.

It compares against the point where your branch left its base, trying in order: the branch's upstream, the remote's default branch, origin/main, origin/master, main and master. Uncommitted changes are included. Up to 120,000 characters of diff are sent, with the full list of changed files.

MessageWhat it means
Could not work out what to compare against. Is this a git repository with a main branch?None of the bases above exists. Fetch from your remote, or create a main branch.
Nothing has changed since <base>.Your branch has no changes against its base.

To review only what the agent just changed, use Find Issues in Agent Changes instead; see Reviewing the agent's changes. From a terminal or CI, see Reviewing a branch.

Resolve Conflicts in Chat

When a file has merge conflict markers, a Resolve Conflicts in Chat button appears in the editor's title bar.

  1. Open the conflicted file and choose Resolve Conflicts in Chat, or run AstraCode: Resolve Conflicts in Chat.
  2. The file is saved first, so the agent reads what you see.
  3. The agent resolves each conflict in Agent mode, in a run titled Resolve conflicts in <file>, asking before it edits as usual.
  4. Review the result like any agent change, then stage and commit it yourself.

In a file with no conflict markers it says No merge conflicts in this file. The button does not appear in the editor's three-way merge editor.

Marking the agent's commits

When the agent commits for you, you can have it say so in the commit. Turn on Co-author agent commits in AstraCode Settings, Git & PRs (astracode.git.attributeCommits, off by default). Each commit the agent makes then carries this trailer:

Co-Authored-By: AstraCode <agent@astracode.io>

It is off by default because a trailer is written into a permanent record, and some teams reject commits with trailers they do not expect.

The agent always asks before it pushes, publishes a package or rewrites published history, whatever your approval setting. See Approvals and permissions.

If something goes wrong

More in Agent run problems.

← Reviewing the agent's changes Dictation →

All documentation

Get started

Using the editor

Agent

Context

Workspaces

Connectors

Extending AstraCode

CLI

Account and usage

Troubleshooting

Reference