Skip to content

Commit 57e13e2

Browse files
jahvonclaude
andcommitted
docs: note git as optional dependency for git workspace features
Add prerequisite callout in installation docs and workspace guide. Add EnsureInstalled runtime check so users get a clear error if git is not on PATH. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 8982f33 commit 57e13e2

3 files changed

Lines changed: 16 additions & 0 deletions

File tree

docs/guides/workspaces.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ When you add a workspace, flow creates a `flow.yaml` configuration file in the r
2727

2828
#### Git Workspaces
2929

30+
> **Prerequisite:** Git must be installed and available on your `PATH` to use git workspace features.
31+
3032
You can also add workspaces directly from Git repositories. Flow clones the repository to its cache directory and registers it as a workspace:
3133

3234
```shell

docs/installation.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ title: Installation
55
# Installation
66

77
> **System Requirements:** flow supports Linux and macOS systems. On Linux, you'll need `xclip` installed to use clipboard features.
8+
>
9+
> **Optional:** [Git](https://git-scm.com/) is required for [git workspace](guides/workspaces.md#git-workspaces) features (`workspace add` from URLs, `workspace update`, `sync --git`).
810
911
## Quick Install
1012

internal/services/git/git.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,20 @@ func ResetPull(repoDir, ref, refType string) error {
136136
return runGit(repoDir, "clean", "-fd")
137137
}
138138

139+
// EnsureInstalled checks that the git binary is available on PATH.
140+
func EnsureInstalled() error {
141+
if _, err := exec.LookPath("git"); err != nil {
142+
return fmt.Errorf("git is not installed or not in PATH (required for git workspace features)")
143+
}
144+
return nil
145+
}
146+
139147
// runGit executes a git command, streams progress to stderr, and captures output for error messages.
140148
func runGit(dir string, args ...string) error {
149+
if err := EnsureInstalled(); err != nil {
150+
return err
151+
}
152+
141153
cmd := exec.Command("git", args...)
142154
if dir != "" {
143155
cmd.Dir = dir

0 commit comments

Comments
 (0)