Armadra

使用

Git 与 GitHub

用 Git 工具窗口看日志、提交和管理分支,用 worktree 隔离协作,并连接 GitHub 查看 Issues 与 Pull requests。


Armadra 把 Git 放在一个底部停靠的工具窗口里:一个「日志」页看历史、管分支,一个「提交」页挑选改动并提交。它同时处理工作空间里发现的所有 Git 仓库。GitHub 等代码托管平台的 Issues 与 Pull requests 在单独的「代码托管」面板里查看。

打开 Git 工具窗口

点右侧栏的「源码控制」,或按 ⇧⌘G(Windows / Linux 为 Ctrl+Shift+G)。窗口顶部有「日志」「提交」两个页签,右侧是刷新、最大化和关闭;拖动上沿可以调整高度。手机上同样的内容按「分支 → 提交 → 详情 → 差异」逐级进入。

工作空间下没有仓库时,窗口会提示「这个工作空间下没有找到 Git 仓库。」。

日志:看历史、管分支

「日志」页分三栏:左边是分支树,中间是提交图,右边是所选提交的详情。

  • 分支树:每个仓库一个根,下面分「本地」「远端」「标签」「Worktree」,有保存的 Stash 时还有「Stash」。「HEAD(全部仓库)」表示各仓库的当前分支合在一起看;可以用「过滤分支」搜索,用「收藏」标记常用分支。
  • 提交图:列出消息、作者、日期、hash。有多个仓库时,所有仓库的提交按时间交错排在同一张图里,每行左侧的颜色条标明属于哪个仓库。工作区有未提交改动时,最上面一行是「未提交的变更」。
  • 工具栏:搜索消息或 hash(可开「正则」「区分大小写」)、「分支」「用户」(含「我的」)、「日期」(今天 / 7 天 / 30 天 / 自定义)、「路径」(缩到某几个仓库或目录),以及「视图设置」(显示所有分支、高亮我的提交、紧凑行、显示 hash 列)。「清除筛选」一键复原。
  • 详情:作者、提交者、完整信息和「变更文件」,可在「平铺」与「目录分组」间切换;点文件在同一栏里看差异;「复制 hash」可复制提交号。

右键菜单

在提交行和分支树的各类条目上右键,可用的操作随对象不同:

对象 可用操作
提交 「检出此提交(游离 HEAD)」「从这里新建分支…」「在此新建标签…」「cherry-pick…」「回退此提交」「把当前分支重置到这里」(soft / mixed / hard 三种)「把当前分支 rebase 到此」「从这里交互式 rebase…」「与本地比较」「与分支比较」「复制 OID」「复制提交信息」「在画布上引用」
本地分支 「切换分支」「从这里新建分支…」「重命名…」「合并到当前分支」「把当前分支 rebase 到此」「推送当前分支」「设置上游」「拉取(仅快进)」「获取远端更新」「与分支比较」「显示与工作树的差异」「收藏」「删除分支」
仓库 / HEAD 「获取远端更新」「新建分支…」「引用日志…」
远端 「获取远端更新」「获取并清理已删除的远端分支」「修改远端地址…」「重命名远端…」「删除远端」;「远端」分组上可「添加远端」
标签 「检出此提交(游离 HEAD)」「推送该标签」「收藏」「删除本地标签」
Worktree 「在 Frame 里打开」「移除 Worktree」;「Worktree」分组上可「新建 Worktree…」
Stash 「应用这条 stash」「弹出这条 stash」「删除这条 stash」「查看这条 stash 的差异」

合并、rebase、cherry-pick、revert 进行到一半时,提交页顶部会出现状态横幅,可以「继续」「跳过」或「中止」;冲突文件单独列在「冲突」组里,在编辑器里解决并保存后,再回到「提交」页暂存——保存文件不会自动标记为已解决。交互式 rebase 提供 pick、reword、edit、squash、fixup、drop 六种处理方式,可调整顺序。「引用日志…」(在仓库或 HEAD 条目上右键)可以查看分支位置的历史,用来找回被丢掉的提交。

提交

  1. 切到「提交」页。变更按「冲突」「已暂存」「变更」「未跟踪」分组,可在「树形」与「平铺」之间切换。
  2. 勾选要提交的文件;勾选就是暂存,取消勾选就是取消暂存。目录行可以整组勾选。点文件在右侧看差异。
  3. 填写「提交信息」。输入框旁的「最近用过的信息」可以复用历史信息。
  4. 点「提交」,或「提交并推送」。没有上游分支时推送不可用,需先设置上游。

补充:

  • 勾选了多个仓库的文件时,会按仓库分别提交,使用同一条信息,进度逐个显示。
  • 「修正上一次提交」会改写上一个提交;如果它已存在于远端跟踪分支里,需要再确认你要改写已发布的历史。
  • 「Stash…」保存当前改动(可选「同时保存未跟踪文件」),「Unstash…」列出已保存的 Stash 供应用、弹出或删除;「丢弃选中变更」会先要求确认。
  • 「AI 生成」会根据暂存内容起草提交信息,先预览,再「填入提交框」。它需要机器上装有 Claude CLI,且运行服务设置了 ANTHROPIC_API_KEY;使用自定义服务地址时不可用,不可用时会直接写明原因。敏感行会被隐藏,不会发出去。你手动改过提交框后,草稿不会覆盖你的内容。

Worktree

Worktree 让同一个仓库同时检出多个分支到不同目录,适合给每个 Agent 一份独立的工作副本,互不覆盖。

  1. 在分支树里右键「Worktree」分组,选「新建 Worktree…」。
  2. 填写「Worktree 路径(工作区内)」;需要时勾选「同时创建新分支」。
  3. 可以勾选「同时创建绑定这个 worktree 的 Frame」,并填写「初始化脚本」——它只在新 worktree 里运行一次。
  4. 之后在 Worktree 条目上右键选「在 Frame 里打开」,会得到一个绑定到它的 Frame。Frame 头部显示分支、未提交变更数和初始化脚本状态;绑定的 worktree 找不到、分支被切走时会提示,可以「重新创建」或「解绑」。

移除 Worktree:在分支树里的 Worktree 条目上右键,选「移除 Worktree」。

连接 GitHub

GitHub 的访问凭据由运行 Armadra 核心服务的那台机器保管。

  1. 打开「设置 → 代码托管」。
  2. 在「凭据来源」选一种:
    • 「复用本机 gh 登录」:沿用这台机器上 gh 命令行已登录的账号;
    • 「粘贴令牌」:填入「个人访问令牌」,点「保存」。令牌在 macOS 上存进钥匙串,其他平台存进受限权限的文件,界面里会如实标注是否为降级存储;
    • 「不配置」。
  3. 使用 GitHub Enterprise 时,在「API 地址」里填你的地址。
  4. 要停用时点「撤销凭据」。

Gitea、GitLab 等其他平台在同一页的「其他平台」里按主机或仓库添加:填「主机或仓库」、「平台」、「地址」和「令牌」,「范围」可选整台机器或某个工作空间。

Issues 与 Pull requests

打开命令面板(⌘K),输入「代码托管面板」;它也在右上角的工具簇里。面板会根据当前仓库的远端地址识别平台,然后给出两个页签:

  • 「Issues」;
  • 「Pull requests」(GitLab 上叫「Merge requests」)。

列表可按「状态」筛选:「开启」「已关闭」「全部」,Pull requests 还有「已合并」。点一条进入详情,能看到状态、作者、更新时间,Pull request 还有分支和「草稿」标记;「在浏览器中打开」会跳到托管平台上的原页面,「加载更多」继续翻页。

这个面板目前只读:创建、评论、合并等操作请到托管平台上进行。

如果面板提示无法使用,常见原因和处理是:先打开工作空间;「这台设备没有该工作空间的 GitHub 权限」时请联系共享者;「Host 现在拿不到可用的 GitHub 凭据」时,点按钮前往「设置 → 代码托管」配置凭据;被限流时等配额恢复;提示「远端已经变了」时刷新后重试。

接下来:协调者里的成员可以各自使用一个 worktree;快捷键见键盘快捷键。

Guides

Git and GitHub

Use the Git tool window for history, commits and branches, isolate work with worktrees, and connect GitHub to browse Issues and Pull requests.


Armadra puts Git in a tool window docked at the bottom: a “Log” tab for history and branches, and a “Commit” tab for choosing changes and committing. It handles every Git repository found in the workspace at once. Issues and Pull requests on GitHub and other hosting platforms are viewed in a separate “Code hosting” panel.

Open the Git tool window

Click “Source control” in the right sidebar, or press ⇧⌘G (Ctrl+Shift+G on Windows / Linux). The top of the window has the “Log” and “Commit” tabs, with refresh, maximise and close on the right; drag the top edge to change its height. On a phone the same content opens level by level: “Branches → Commits → Details → Diff”.

If the workspace has no repository, the window says “No Git repository was found in this workspace.”

Log: history and branches

The “Log” tab has three columns: the branch tree on the left, the commit graph in the middle and the selected commit’s details on the right.

  • Branch tree: one root per repository, with “Local”, “Remote”, “Tags” and “Worktrees” below it, plus “Stash” when stashes exist. “HEAD (all repositories)” shows every repository’s current branch together; use “Filter branches” to search and “Add to favourites” to mark branches you use often.
  • Commit graph: message, author, date and hash. With several repositories, all commits are interleaved by time in one graph, and a coloured bar at the left of each row shows the repository. When the working tree has uncommitted changes, the top row is “Uncommitted changes”.
  • Toolbar: search message or hash (with “Regex” and “Match case”), “Branch”, “User” (including “Mine”), “Date” (today / 7 days / 30 days / custom), “Paths” (narrow to some repositories or directories), and “View settings” (show all branches, highlight my commits, compact rows, show the hash column). “Clear filters” resets everything.
  • Details: author, committer, the full message and “Changed files”, switchable between “Flat” and “Grouped by folder”; click a file to see its diff in the same column; “Copy hash” copies the commit id.

Context menus

Right-click a commit row or an item in the branch tree; the available actions depend on the object:

Object Actions
Commit “Check out this commit (detached HEAD)”, “New branch from here…”, “New tag here…”, “Cherry-pick…”, “Revert this commit”, “Reset the current branch here” (soft / mixed / hard), “Rebase the current branch onto this”, “Interactive rebase from here…”, “Compare with local”, “Compare with branch”, “Copy OID”, “Copy commit message”, “Reference on the canvas”
Local branch “Switch branch”, “New branch from here…”, “Rename…”, “Merge into the current branch”, “Rebase the current branch onto this”, “Push current branch”, “Set upstream”, “Pull (fast-forward only)”, “Fetch”, “Compare with branch”, “Show the diff against the worktree”, “Add to favourites”, “Delete branch”
Repository / HEAD “Fetch”, “New branch…”, “Reference log…”
Remote “Fetch”, “Fetch and prune deleted remote branches”, “Change the remote URL…”, “Rename the remote…”, “Remove remote”; on the “Remote” group, “Add remote”
Tag “Check out this commit (detached HEAD)”, “Push this tag”, “Add to favourites”, “Delete local tag”
Worktree “Open in a Frame”, “Remove worktree”; on the “Worktrees” group, “New worktree…”
Stash “Apply this stash”, “Pop this stash”, “Drop this stash”, “Show this stash’s diff”

While a merge, rebase, cherry-pick or revert is half done, a status banner appears at the top of the “Commit” tab with “Continue”, “Skip” and “Abort”. Conflicted files are listed in their own “Conflicts” group; resolve and save them in the editor, then stage them back in the “Commit” tab — saving a file does not mark it resolved by itself. Interactive rebase offers pick, reword, edit, squash, fixup and drop, and lets you reorder commits. “Reference log…” (right-click the repository or HEAD item) shows the history of where branches pointed, which helps recover commits you dropped.

Commit

  1. Switch to the “Commit” tab. Changes are grouped as “Conflicts”, “Staged”, “Changes” and “Untracked”, and can be shown as “Tree” or “Flat”.
  2. Tick the files to commit; ticking stages a file and unticking unstages it. A directory row ticks its whole group. Click a file to see its diff on the right.
  3. Write the “Commit message”. “Recent messages” next to the box reuses an earlier message.
  4. Click “Commit”, or “Commit and push”. Push is unavailable when there is no upstream branch; set an upstream first.

Also:

  • When files from several repositories are ticked, each repository gets its own commit with the same message, and progress is shown one by one.
  • “Amend the previous commit” rewrites the last commit; if it already exists on a remote-tracking branch you must confirm that you want to rewrite published history.
  • “Stash…” saves the current changes (optionally “Include untracked files”), “Unstash…” lists saved stashes to apply, pop or drop; “Discard the selected change” asks for confirmation first.
  • “Generate with AI” drafts a commit message from the staged changes; you preview it, then “Fill commit message”. It needs the Claude CLI on the machine and ANTHROPIC_API_KEY set for the running service, and is unavailable with a custom endpoint; when unavailable it states the reason. Lines detected as sensitive are hidden and not sent. If you edit the box by hand, the draft will not overwrite your text.

Worktrees

A worktree checks out several branches of one repository into different directories, which suits giving every agent its own working copy so they do not overwrite each other.

  1. In the branch tree, right-click the “Worktrees” group and choose “New worktree…”.
  2. Fill in “Worktree path (inside workspace)”; tick “Create a new branch” if needed.
  3. Optionally tick “Also create a Frame bound to this worktree” and write an “Init script” — it runs once in the new worktree.
  4. Later, right-click the worktree entry and choose “Open in a Frame” to get a Frame bound to it. The Frame header shows the branch, the number of uncommitted changes and the init script state; if the bound worktree is missing or its branch was switched you are told, and can “Recreate” or “Unbind”.

To remove one, right-click the worktree entry in the branch tree and choose “Remove worktree”.

Connect GitHub

GitHub credentials are kept by the machine that runs Armadra’s core service.

  1. Open “Settings → Code hosting”.
  2. Under “Credential source” choose one:
    • “Reuse the local gh login”: use the account the gh command line is already signed in with on that machine;
    • “Paste a token”: enter a “Personal access token” and click “Save”. The token is stored in the Keychain on macOS and in a restricted-permission file elsewhere, and the page says honestly when the storage is the degraded one;
    • “None”.
  3. For GitHub Enterprise, enter your address under “API address”.
  4. To stop, click “Revoke credential”.

Gitea, GitLab and other platforms are added per host or repository under “Other platforms” on the same page: fill in “Host or repository”, “Platform”, “URL” and “Token”, and pick a “Scope” of the whole machine or one workspace.

Issues and Pull requests

Open the command palette (⌘K) and type “Code hosting panel”; it is also in the toolbar cluster at the top right. The panel recognises the platform from the current repository’s remote URL, then shows two tabs:

  • “Issues”;
  • “Pull requests” (called “Merge requests” on GitLab).

Lists can be filtered by “State”: “Open”, “Closed”, “All”, and for pull requests also “Merged”. Click an item for details: state, author and update time, plus branches and a “Draft” marker for pull requests. “Open in browser” goes to the original page on the hosting platform, and “Load more” fetches the next page.

The panel is read-only for now: creating, commenting and merging happen on the hosting platform.

If the panel says it cannot be used, the usual causes are: open a workspace first; for “This device has no GitHub permission for this workspace” ask whoever shared it; for “The Host cannot produce a usable GitHub credential”, use the button to go to “Settings → Code hosting” and set one up; when rate-limited, wait for the quota to recover; on “The remote already changed; reload and retry”, reload and try again.

Next: members in Coordinator can each use their own worktree; shortcuts are in Keyboard shortcuts.

在 GitHub 上编辑本页 Edit this page on GitHub