Using the workspace

Git, commits and pull requests

Review a task's changes, commit with an AI-suggested message, push, open a GitHub pull request and merge after your checks pass, all from the Duscode Git dialog.

Open Git with the branch button in the top bar, or press Ctrl/⌘+Shift+G, to work with the current task's changes. It opens as a dialog over the chat; Esc closes it. Duscode uses your own git and your own identity, and it's never destructive: no force pushes, resets or stashes.

Review changes

The Git dialog lists the task's uncommitted changes, like git status:

  • a letter for each file: M modified, A added (including new, untracked files), D deleted, R renamed, ! conflict
  • lines added and removed (bin for binary files)
  • for isolated tasks, how many commits the branch is ahead of its base, such as 2 commits ahead of main

Click a file to compare it with the last commit in a side-by-side diff.

Commit

Click Commit N files. The fast model reads the diff and suggests a message. Edit it in the Commit changes dialog, then click Commit (or press Ctrl/⌘+Enter). Duscode stages every changed file and commits on the task's branch under your git identity.

If git doesn't know who you are, Duscode won't guess an identity from your machine's name. It shows the two commands to run once:

bash
git config --global user.name "Your Name"
git config --global user.email "you@example.com"

You can't commit while Dus is working in the task.

Push

Push (N) pushes the branch to your remote with git push -u. It's never forced. If the remote has commits you don't, the push is rejected, and Duscode explains how to bring them in.

No remote yet? Add one, for example a GitHub repository as origin. Or create the project with Also create on GitHub.

Open a pull request

Open pull request appears for an isolated task with commits, when the remote is on GitHub. Duscode pushes the branch, then runs gh pr create:

  • Title: the commit's subject if there's one commit, otherwise the task's title
  • Body: the list of commits and the task's journal, so reviewers see what was done and why

If a pull request for the branch already exists, you get its link. Commit any changes first, so the pull request contains them.

Pull requests need the GitHub CLI, signed in once with gh auth login. Duscode tells you if it's missing or signed out. Duscode stores no GitHub token.

Merge

Merge into main (or whatever the task's base branch is) merges an isolated task locally:

  1. The project's checks run in the task's worktree. If a check fails, nothing is merged. You can Ask Dus to fix it.
  2. Duscode runs git merge --no-ff in your main checkout, with the message Merge task "title" (branch).
  3. If there's a conflict, the merge is undone (your checkout was clean, so nothing is lost) and the conflicting files are listed. Resolving them is your call. Ask Dus to help resolve hands it to Dus as an ordinary request, with approvals.

Merging needs:

  • no uncommitted changes in the task
  • something to merge
  • your main checkout on the base branch, with no uncommitted changes
  • a git identity
  • no task running

Duscode lists anything missing under Not merged yet.

Finish… (task menu, or the strip above the message box when a task is Done) does all of this in one go: it brings the base branch in, runs every check on the merged result, then merges or opens a pull request and removes the worktree and branch. See Finishing a task.

Asking Dus to do git

Dus can run git commands itself through its command tool, with your approval. The command blocklist stops force pushes even then. The Git view is the quicker path for the usual steps.

Coming soon

Dus proposing the commit, pull request or merge itself at the end of a task, and an update from main button. See Coming soon.

Keeping the repository tidy

Ask Dus to tidy the repository. He sorts every open pull request into one of five groups, each with its evidence:

  • already merged in substance;
  • contained in another pull request;
  • a duplicate;
  • stale;
  • active.

He shows all the closes he proposes on one card. Each close comes with a note saying where its work lives, and active pull requests are never closed.

Leftover work folders (old worktrees and copies) are checked file by file against the remote. A folder is deleted only when everything in it is saved there. Anything that isn't saved is first copied, checked, to a rescue folder. The report says how much space was freed and where the rescued files are. A worktree with unsaved or unpushed work is never removed.

Something missing or wrong? Email support@duscode.com.