Skip to content

Commit

Permalink
docs: Improve docs on git-repo externals
Browse files Browse the repository at this point in the history
  • Loading branch information
twpayne committed Feb 15, 2023
1 parent fcf6fbb commit 8e8face
Showing 1 changed file with 18 additions and 12 deletions.
30 changes: 18 additions & 12 deletions assets/chezmoi.io/docs/user-guide/include-files-from-elsewhere.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,24 @@ the `refreshPeriod` is `168h` which is one week. The default `refreshPeriod` is
zero, which disables refreshes. You can force a refresh (i.e. force a `git
pull`) by passing the `--refresh-externals`/`-R` flag to `chezmoi apply`.

!!! warning

chezmoi's support for `git-repo` externals is limited to running `git
clone` and/or `git pull` in a directory. You must have a `git` binary
in your `$PATH`.

Using a `git-repo` external delegates management of the
directory to git. chezmoi cannot manage any other files in that directory.

The contents of `git-repo` externals will not be manifested in commands
like `chezmoi archive` or `chezmoi dump`.

!!! hint

If you need to manage extra files in a `git-repo` external, use an
`archive` external instead with the URL pointing to an archive of the git
repo's `master` or `main` branch.

You can customize the arguments to `git clone` and `git pull` by setting the
`$DIR.clone.args` and `$DIR.pull.args` variables in `.chezmoiexternal.$FORMAT`,
for example:
Expand All @@ -143,18 +161,6 @@ for example:
args = ["--ff-only"]
```

!!! note

chezmoi's support for `git-repo` externals is limited to running `git
clone` and/or `git pull` in a directory. The contents of `git-repo`
externals are not manifested in commands like `chezmoi archive` or `chezmoi
dump`.

!!! note

chezmoi's support for `git-repo` externals currently requires `git` to be
in your `$PATH`.

## Extract a single file from an archive

You can extract a single file from an archive using the `$ENTRY.filter.command`
Expand Down

0 comments on commit 8e8face

Please sign in to comment.