使用手册User Guide

从仓库整理到代码提交From repositories to reviewed commits

按日常工作流程介绍操作与设置。下文操作及截图以 macOS 版为准,Windows 安装见对应章节。 A guide to everyday workflows and settings in the macOS app. Windows installation is covered separately. Button names follow the English interface.

01

安装Install

macOS

需要 macOS 26 及以上的 Apple Silicon Mac,并已安装 Git。没有 Git 的话,在终端运行 xcode-select --install。

通过 Homebrew 安装

已安装 Homebrew 的用户可以直接运行:

brew install --cask dufu1991/tap/foldgit

更新时,先运行 brew update,再运行 brew upgrade --cask dufu1991/tap/foldgit。

下载 DMG

  1. 下载 最新的 FoldGit macOS 安装包。
  2. 打开 DMG,把 FoldGit 拖进「应用程序」。

首次打开提示“已损坏”或“无法验证开发者”? 两种安装方式都适用:未使用 Apple Developer ID 签名并完成公证的版本可能被 macOS 拦截。确认信任下载的版本后,在终端执行下面的命令,再重新打开:

xattr -dr com.apple.quarantine /Applications/FoldGit.app

Requires an Apple Silicon Mac on macOS 26 or later, with Git installed. If Git is missing, run xcode-select --install in Terminal.

Install with Homebrew

With Homebrew installed:

brew install --cask dufu1991/tap/foldgit

To update, run brew update, then brew upgrade --cask dufu1991/tap/foldgit.

Download the DMG

  1. Download the latest FoldGit macOS installer.
  2. Open the DMG and drag FoldGit into Applications.

“FoldGit is damaged” or “cannot be verified” on first launch? For both installation methods, builds without Developer ID signing and notarization may be blocked by macOS. If you trust the downloaded release, run this in Terminal, then open FoldGit again:

xattr -dr com.apple.quarantine /Applications/FoldGit.app

安装 Windows 版Install on Windows

需要 Windows 11 24H2 及以上版本,并已安装 Git。Windows 客户端目前为最简实现。

  1. 选择设备架构。Intel 和 AMD 电脑通常使用 x64,搭载 Snapdragon 等 ARM 处理器的电脑使用 ARM64。
  2. 下载并双击 EXE 安装程序,按提示安装。安装程序已包含所需运行时,无需导入证书。
  3. 安装后从开始菜单打开 FoldGit。可在 Windows 设置中卸载。

下载 Windows x64 版 · 下载 Windows ARM64 版

Requires Windows 11 24H2 or later and Git. The Windows client is currently a minimal implementation.

  1. Choose your architecture. Most Intel and AMD PCs use x64; PCs with Snapdragon or other ARM processors use ARM64.
  2. Download and open the EXE installer. Follow the prompts. Required runtimes are included and no certificate import is needed.
  3. Open FoldGit from the Start menu. Uninstall it through Windows Settings.

Download for Windows x64 · Download for Windows ARM64

02

添加仓库Add repositories

点击侧边栏顶部的 +:

  • 添加本地仓库或目录:选一个仓库,或一个包含多个仓库的目录。选目录时,其中的仓库会自动收成一组。
  • 克隆远程仓库:填入地址,选好保存位置,克隆完成后自动添加并选中。

也可以用菜单栏「文件」:「打开仓库」(⌘O)、「克隆远程仓库」(⇧⌘N),「最近打开」可直接回到最近使用的仓库。

Click + at the top of the sidebar:

  • Add Local Repository or Directory — pick one repository, or a folder that contains several. A folder becomes a group automatically.
  • Clone Remote Repository — enter the URL and choose where to save it. The clone is added and selected when it finishes.

The File menu works too: Open Repository (⌘O), Clone Remote Repository (⇧⌘N), and Open Recent to jump back to a recently used repository.

03

整理侧边栏Organize the sidebar

  • 分组:在 + 菜单中选「新建分组」,或多选仓库后右键「将所选仓库新建为分组」。分组只是整理方式,不会移动文件夹。
  • 不活跃的仓库:右键「设为不活跃」,它会收进分组底部的二级折叠里。点击分组或「不活跃」标题即可展开或收起,右侧数字显示仓库数量。
  • 改名:右键修改「仓库显示名称」,只影响侧边栏,不改文件夹名。
  • 查找与排序:在「搜索仓库」中按目录、仓库或显示名称过滤;旁边的排序按钮可按名称、最近打开、最近修改或最近添加排序,也可以直接拖动调整顺序。
  • Groups — choose New Group from the + menu, or select several repositories and right-click New Group with Selection. Groups never move folders on disk.
  • Inactive repositories — right-click Mark as Inactive to tuck one into the folded section at the bottom of its group. Click a group or Inactive heading to expand or collapse it; the count shows how many repositories it contains.
  • Rename — set a Repository Display Name from the context menu. Only the sidebar label changes.
  • Find and sort — Search Repositories filters by folder, repository or display name. The sort button orders by name, recently opened, modified or added. You can also drag to reorder.
04

目录树与差异Trees and diffs

选中仓库,点击提交列表顶部的「未提交的更改」,或按 ⌘1。右侧分别显示「未暂存的更改」和「已暂存的更改」。先确认涉及哪些文件,再展开需要审查的代码。

Select a repository and click Uncommitted Changes at the top of the commit list, or press ⌘1. The detail pane separates Unstaged Changes from Staged Changes. Start with the affected files, then expand the code you want to review.

目录展开与差异展开,各自控制Control folders and diffs independently

  • 列表与目录树:底部的「更改文件显示」可切换「列表」和「目录树」。默认使用目录树,目录展开,文件差异折叠。列表显示文件路径,目录树按文件夹组织改动。
  • 查看一个目录或文件:点击目录行展开或收起子项;点击文件名展开或收起该文件的差异。收起目录会保留其中各文件的差异展开状态。
  • 批量操作:「展开目录/折叠目录」控制文件夹结构;「展开差异/折叠差异」控制代码内容,两组操作互不联动。「展开差异」不会自动打开已折叠的目录。
  • 快捷键与菜单:⌥→ 展开差异,⌥← 折叠差异。菜单栏「显示」中也提供这些操作;目录展开选项在目录树模式下出现。
  • 打开文件:文件行右侧的 ↗ 用系统默认应用打开当前工作目录中的文件。
  • List and Directory Tree — use Changed File Display at the bottom to switch between them. Directory Tree is the default, with folders expanded and file diffs collapsed. List shows file paths; Directory Tree groups changes by folder.
  • Inspect a folder or file — click a folder row to show or hide its children, or a filename to expand or collapse its diff. Collapsing a folder preserves the expansion state of its file diffs.
  • Bulk controls — Expand Directories and Collapse Directories control the folder structure; Expand Diffs and Collapse Diffs control code content independently. Expand Diffs does not open collapsed folders.
  • Shortcuts and menus — ⌥→ expands diffs and ⌥← collapses them. The View menu offers the same actions; directory controls appear in Directory Tree mode.
  • Open a file — the ↗ on a file row opens the file from the current working directory in its default application.

选择差异布局Choose a diff layout

「自动」会根据差异区域的可用宽度切换单栏或并排显示,也可手动选择「单栏」或「并排」。并排视图分别标明「修改前」和「修改后」,用红绿背景标出删除与新增,并突出行内变化。底部控件、菜单栏「显示 → 差异布局」和「设置 → 历史与差异」共用同一选择。

窗口较窄或代码行较长时,可切换单栏,或在「设置 → 历史与差异」中开启「长行自动换行」。

Automatic switches between unified and side-by-side layouts based on the space available to the diff pane. You can also choose Unified or Side by Side explicitly. The side-by-side view labels Before and After, marks deletions and additions in red and green, and highlights changes within a line. The bottom controls, View → Diff Layout and Settings → History and Diffs share the same selection.

For a narrow window or long code lines, choose Unified or enable Wrap Long Lines under Settings → History and Diffs.

FoldGit 的 macOS 界面:目录树、展开的并排差异和暂存区 FoldGit 的 macOS 界面:目录树、展开的并排差异和暂存区
演示仓库中的目录树、并排差异与暂存区。点击图片查看大图。
FoldGit on macOS with directory trees, an expanded side-by-side diff and staging panes FoldGit on macOS with directory trees, an expanded side-by-side diff and staging panes
Directory trees, side-by-side diffs and staging in a demo repository. Click the image to view it at full size.
05

暂存与提交Stage and commit

「已暂存的更改」决定下一次提交包含的内容。可以按目录、文件或代码块逐步选择,也可以一次处理全部改动。

  • 按目录:在目录树模式下,点击目录左侧的 +,暂存该目录及子目录的更改,包括未跟踪文件。已暂存区目录左侧的 − 取消该目录下的暂存,保留本地文件与修改。
  • 按文件:文件名左侧的 + 暂存整个文件,− 取消整个文件的暂存。未跟踪文件默认收在「未跟踪的文件」中,展开后也可以逐个暂存。
  • 按代码块:展开文本差异后,代码块右侧的 + 只暂存该块,− 取消该块的暂存。部分暂存后,同一个文件可能同时出现在两个区域。
  • 全部处理:「全部暂存」(⇧⌘S)和「全部取消暂存」(⌥⇧⌘S)分别操作所有未暂存或已暂存的更改。

按文件暂存或取消暂存时,文件名会移向另一区域,并高亮对应位置,便于跟踪改动。系统开启「减少动态效果」时,不播放飞移动画。有已暂存文件时,可拖动两个区域之间的分隔线调整暂存区高度,双击分隔线恢复默认高度。

确认后提交

  1. 检查「已暂存的更改」,展开文件确认本次要提交的内容。
  2. 在「提交信息」中填写说明。底部的提交快捷输入按钮可插入常用前缀,也可以在「设置 → 提交信息」中维护自己的条目。
  3. 按 ⌘↩ 或点击「提交」。未暂存的改动会继续留在工作区。
  4. 需要改写最近一次提交时,勾选「修改上次提交」,或选择菜单栏「提交 → 修改上次提交」。

Staged Changes determines what goes into the next commit. Select changes by directory, file or hunk, or handle everything at once.

  • By directory — in Directory Tree mode, click + beside a folder to stage changes beneath it, including subfolders and untracked files. The − beside a staged folder unstages its changes while keeping local files and edits.
  • By file — + beside a filename stages the whole file; − unstages it. Expand Untracked Files to stage new files individually.
  • By hunk — expand a text diff and use + on the right of a hunk to stage just that block, or − to unstage it. A partly staged file can appear in both panes.
  • All changes — Stage All (⇧⌘S) and Unstage All (⌥⇧⌘S) act on all unstaged or staged changes respectively.

When you stage or unstage a file, its name moves toward the other pane and highlights the destination, making the change easier to follow. The flight animation is skipped when Reduce Motion is enabled in macOS. With staged files present, drag the divider between the panes to adjust the staged pane’s height, or double-click it to restore the default height.

Review, then commit

  1. Check Staged Changes and expand the files to confirm what belongs in this commit.
  2. Write a Commit Message. The snippet buttons below insert common prefixes; manage your own entries under Settings → Commit Messages.
  3. Press ⌘↩ or click Commit. Unstaged edits remain in the working tree.
  4. To rewrite the latest commit, tick Amend or choose Commit → Amend Last Commit in the menu bar.
06

浏览历史Browse history

  • 点击任意提交,右侧显示该次提交的更改。历史提交也支持「列表/目录树」、目录与差异独立展开,包括合并提交的更改文件;文件显示方式与工作区共用。
  • ⌘F 搜索提交,可按作者、邮箱或提交信息查找。
  • 搜索框旁的菜单可以在「当前分支」和「全部提交」之间切换,菜单栏「显示 → 历史范围」同样可以切换。
  • 提交列表底部的分支图标用来显示或隐藏提交图,也可以用「显示 → 提交关系图」。
  • ⌘0 定位到 HEAD:清空搜索并滚动到当前检出的提交,必要时自动加载更早的历史。
  • 选中提交后,⇧⌘C 复制提交哈希;菜单栏「提交」中还可以检出或还原所选提交。
  • Click any commit to see what it changed. Historical commits also support List and Directory Tree with independent folder and diff expansion, including the changed files of merge commits. The file display choice is shared with the working changes view.
  • ⌘F searches commits by author, email or message.
  • The menu beside the search field switches between Current Branch and All Commits, as does View → History Scope.
  • The branch icon at the bottom of the list shows or hides the commit graph, as does View → Commit Graph.
  • ⌘0 jumps to HEAD: it clears the search and scrolls to the checked-out commit, loading older history if needed.
  • With a commit selected, ⇧⌘C copies its hash; the Commit menu can also check out or revert the selected commit.
07

分支与同步Branches and sync

都在窗口顶部的工具栏里,也可以从菜单栏的「仓库」和「分支」中找到:

  • 分支(⌘B):切换、合并到当前分支、重命名或删除分支。
  • 合并分支:在菜单栏「分支 → 合并分支」中选一个本地或远程分支,合并到当前分支。
  • 新建分支(⇧⌘B)、标签:创建分支,浏览和管理标签;⇧⌘T 新建标签。
  • 比较:选两个版本,查看它们之间的全部差异。
  • 获取 / 拉取 / 推送(⇧⌘F / L / P):与远程同步。获取只下载更新,不会合并。⌘R 刷新仓库状态。
  • 打开方式:在终端、编辑器或访达中打开当前仓库。⌃⌘T 在终端中打开,⌃⌘O 在访达中显示。

Everything lives in the toolbar, and in the Repository and Branch menus of the menu bar:

  • Branch (⌘B) — switch, merge into the current branch, rename or delete.
  • Merge Branch — choose Branch → Merge Branch, pick a local or remote branch, and merge it into the current one.
  • New Branch (⇧⌘B) and Tags — create branches, browse and manage tags; ⇧⌘T creates a tag.
  • Compare — pick two revisions and see everything between them.
  • Fetch / Pull / Push (⇧⌘F / L / P) — sync with the remote. Fetch only downloads; it never merges. ⌘R refreshes the repository.
  • Open in — open the repository in Terminal, your editor or Finder. ⌃⌘T opens Terminal, ⌃⌘O shows it in Finder.
08

工作树Worktrees

  1. 在仓库上右键「启用工作树」。(设置 → 仓库中的全局开关默认已打开。)
  2. 右键「新建工作树」,选新分支或已有分支。新工作树会折叠显示在仓库下方。
  3. 做完后右键「完成工作树」:选择目标分支,合并提交,再按需移除目录、删除源分支。

遇到冲突时,可以在弹窗里比较两侧版本、选择保留哪一边,或用外部编辑器处理后继续。

  1. Right-click a repository and choose Enable Worktrees. (The global switch under Settings → Repositories is on by default.)
  2. Right-click New Worktree and pick a new or existing branch. It appears folded beneath the repository.
  3. When you are done, right-click Finish Worktree: choose the target branch, merge, then optionally remove the folder and delete the source branch.

On conflicts, compare both sides in the sheet, keep one, or resolve in an external editor and continue.

09

贮藏Stash

在「未提交的更改」底部点「贮藏全部更改」(⇧⌘H),把手上的修改先收起来;之后从工具栏「贮藏」中查看并恢复。

Click Stash All Changes (⇧⌘H) under Uncommitted Changes to set your work aside, then view and restore it from Stashes in the toolbar.

10

设置Settings

按 ⌘, 打开。常用的几项:

  • 通用:选择界面语言,设置登录时启动、恢复上次的仓库和窗口状态、启动时检查更新,以及关闭最后一个窗口时是否退出。语言更改后需重启应用。
  • 检查更新:启动时默认检查新版本,仅发现新版本时提示。也可从「FoldGit → 检查更新」手动检查;点击「下载」会打开 GitHub 发布页,选择对应安装包更新。通过 Homebrew 安装的用户可继续使用上方的升级命令。
  • 外观:选择浅色、深色或自动跟随系统;工具栏可显示「仅图标」或「图标和文字」。
  • 历史与差异:控制提交关系图、差异布局、代码字号和长行自动换行。「文件默认展开方式」默认设为「折叠」,可改为「展开」;它作用于新打开的差异,手动展开或收起的文件会保留原状态。
  • 提交信息:维护提交快捷输入条目,插入常用前缀或文案。
  • 仓库:启用工作树信息,为每个仓库单独设置自动获取间隔。自动获取只下载远程更新,不合并。
  • 外部应用:固定常用的编辑器或终端,它们会排在「打开方式」菜单最前面。
  • 恢复默认:在「通用」中点击「恢复默认设置」,先查看将被重置的选项,再确认恢复。

Press ⌘,. The ones you will likely touch:

  • General — choose the interface language, launch at login, restore the previous repository and window, check for updates at launch, and choose whether closing the last window quits the app. Restart after changing the language.
  • Check for Updates — launch checks are enabled by default and only notify you when a newer version is available. To check manually, choose FoldGit → Check for Updates. Download opens the GitHub release page so you can choose an installer. Homebrew users can continue using the upgrade command above.
  • Appearance — choose Light, Dark or Automatic, and set Toolbar Display to Icons Only or Icons and Text.
  • History and Diffs — configure the commit graph, diff layout, code font size and line wrapping. Default File Expansion starts at Collapsed; choose Expanded to open new diffs with their contents visible. Files you expand or collapse manually keep their state.
  • Commit Messages — manage snippets for common prefixes or text.
  • Repositories — enable worktree information and choose an automatic fetch interval per repository. Fetch downloads remote updates without merging them.
  • External Applications — pin an editor or terminal to place it first in the Open in menu.
  • Restore Defaults — under General, review the settings that will be reset before confirming.
11

快捷键Shortcuts

macOS 版的常用操作都在菜单栏中,菜单项旁显示对应快捷键;完整列表可在「帮助 → 快捷键」中查看。On macOS every common action is in the menu bar, with its shortcut beside it. Help → Keyboard Shortcuts shows the full list.

⌘O
打开仓库Open repository
⇧⌘N
克隆远程仓库Clone remote repository
⌘R
刷新Refresh
⇧⌘F
获取Fetch
⇧⌘L
拉取Pull
⇧⌘P
推送Push
⌃⌘O
在访达中显示Show in Finder
⌃⌘T
在终端中打开Open in Terminal
⌘B
选择分支Select branch
⇧⌘B
新建分支Create new branch
⇧⌘T
新建标签Create new tag
⌘↩
提交Commit
⇧⌘S
全部暂存Stage all
⌥⇧⌘S
全部取消暂存Unstage all
⇧⌘H
贮藏更改Stash all changes
⇧⌘C
复制提交哈希Copy commit hash
⌘F
搜索提交Search commits
⌘1
未提交的更改Uncommitted changes
⌘0
定位到 HEADJump to HEAD
⌃⌘S
显示或隐藏边栏Show or hide the sidebar
⌥→
展开差异Expand diffs
⌥←
折叠差异Collapse diffs
⌘,
打开设置Open Settings

遇到问题或有建议?欢迎在 GitHub Issues 反馈。 Found a problem or have an idea? Open an issue on GitHub.