- Ensure
gitcan authenticate in your environment:- GitHub Actions: set
GITHUB_TOKENor configure a PAT viaactions/checkout. - Local: use
gh auth login, credential helper, or SSH agent.
- GitHub Actions: set
- Avoid embedding tokens in URLs. The CLI redacts URL userinfo in logs, but never print secrets.
- Ensure the input matches
<repo.git>@<ref>:<path> - Examples:
https://github.com/user/repo.git@main:src/file.tsgit@github.com:user/repo.git@v1.2.3:LICENSE
- Absolute paths and parent traversal are rejected. Paths must be relative and stay under the output directory.
- Examples of invalid:
/etc/passwd,../../secret,~/file
- Verify the file exists at the specified ref. Try cloning locally and checking the path.
- Watch for case sensitivity differences.
- The default limit is ~10 MB. Increase via
--max-bytes <n>or envFETCH_GIT_FILE_MAX_BYTES.
- The destination path must resolve under
--out(or CWD). Remove..segments and do not use absolute paths.
- Provide paths using forward slashes in the ref. The CLI will normalize to your OS.
- Example:
...@main:path/to/file.txt
- Example:
CONFIG_NOT_FOUND/CONFIG_PARSE_ERROR/CONFIG_INVALIDindicate problems reading--config.- The config must be a JSON array of strings or objects
{ repo, ref?, path, dest? }.
.git-remote-files.jsonis written in the working directory (or--manifest). Decide whether to commit it or ignore it via.gitignore.
- Add
--verboseto print additional details such as clone path. Add--quietto suppress normal logs.