Documenter.jl says `git remote` failed - why?

I don’t understand this error reported by Documenter.jl - in particular, why is Documenter prefixing my PATH with the strange artifact? why:

floswald@PTL11077 ~/.j/d/P/docs (main)> /Users/floswald/.julia/artifacts/9a049d4b53ce75a92a831b451896c8c029234177/bin/git remote show origin
dyld[93378]: Library not loaded: @rpath/libpcre2-8.0.dylib
  Referenced from: <4C4C4432-5555-3144-A1A5-EBD11D7E8E32> /Users/floswald/.julia/artifacts/9a049d4b53ce75a92a831b451896c8c029234177/bin/_git
  Reason: tried: '/workspace/destdir/lib/libpcre2-8.0.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/workspace/destdir/lib/libpcre2-8.0.dylib' (no such file), '/workspace/destdir/lib/libpcre2-8.0.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/workspace/destdir/lib/libpcre2-8.0.dylib' (no such file), '/Users/floswald/.julia/artifacts/9a049d4b53ce75a92a831b451896c8c029234177/bin/../lib/libpcre2-8.0.dylib' (no such file), '/workspace/destdir/lib/libpcre2-8.0.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/workspace/destdir/lib/libpcre2-8.0.dylib' (no such file), '/workspace/destdir/lib/libpcre2-8.0.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/workspace/destdir/lib/libpcre2-8.0.dylib' (no such file), '/Users/floswald/.julia/artifacts/9a049d4b53ce75a92a831b451896c8c029234177/bin/../lib/libpcre2-8.0.dylib' (no such file), '/libpcre2-8.0.dylib' (no such file)
fish: Job 1, '/Users/floswald/.julia/artifact…' terminated by signal SIGABRT (Abort)

when this works perfectly well?

floswald@PTL11077 ~/.j/d/P/docs (main) [SIGABRT]> git remote show origin
* remote origin
  Fetch URL: git@github.com:floswald/PIIScanner.jl.git
  Push  URL: git@github.com:floswald/PIIScanner.jl.git
  HEAD branch: main
  Remote branch:
    main tracked
  Local branch configured for 'git pull':
    main merges with remote main
  Local ref configured for 'git push':
    main pushes to main (up to date)
floswald@PTL11077 ~/.j/d/P/docs (main)> 

here is the full output of make.jl

floswald@PTL11077 ~/.j/d/P/docs (main)> JULIA_DEBUG=Documenter julia --project make.jl
┌ Warning: Unable to determine HTML(edit_link = ...) from remote HEAD branch, defaulting to "master".
│ Calling `git remote` failed with an exception. Set JULIA_DEBUG=Documenter to see the error.
│ Unless this is due to a configuration error, the relevant variable should be set explicitly.
└ @ Documenter ~/.julia/packages/Documenter/xvqbW/src/utilities/utilities.jl:680
┌ Debug: Command: setenv(`/Users/floswald/.julia/artifacts/9a049d4b53ce75a92a831b451896c8c029234177/bin/git remote show origin`,["PATH=/Users/floswald/.julia/artifacts/154306f0b5fcd9c59ee1d37c70553c8b8ab75ba4/bin:/Users/floswald/.julia/artifacts/9a049d4b53ce75a92a831b451896c8c029234177/bin:/Users/floswald/.julia/artifacts/3fa3ae5a55c864014d9c801405cb178ff567c9ea/bin:/Applications/google-cloud-sdk/bin:/opt/homebrew/Cellar/pyenv-virtualenv/1.2.4/shims:/Users/floswald/.pyenv/shims:/Users/floswald/.julia/bin:/Users/floswald/.local/share/gem/ruby/3.4.0/bin:/Applications/StataNow/StataMP.app/Contents/MacOS:/Users/floswald/.duckdb/cli/latest:/Applications/Stata/StataMP.app/Contents/MacOS:/opt/homebrew/opt/ruby/bin:/Users/floswald/.pixi/bin:/Applications/quarto/bin:/opt/homebrew/bin:/Users/floswald/.juliaup/bin:/usr/bin:/usr/local/bin:/Library/TeX/texbin:/bin:/usr/sbin:/System/Cryptexes/App/usr/bin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/opt/X11/bin:/Users/floswald/.orbstack/bin", "EDITOR=vi", "R_LIBS_USER=/Users/floswald/Library/R/arm64/4.5/library", "LETTER_TEMPLATES=/Users/floswald/Dropbox/supervision/templates", "EJ_DB=/Users/floswald/Dropbox/EJ", "R_PDFVIEWER=/usr/bin/open", "JPE_TOOLS_JL=/Users/floswald/git/JPEtools", "SLACK_FILES=xoxb-437685214404-1790526147312-1WvTgLis5nxrWaIOlacvfst6", "R_GMAIL_EJ=/Users/floswald/git/EJData/gmail-clients/EJ/ej.json", "PYENV_VIRTUALENV_INIT=1", "R_INCLUDE_DIR=/Library/Frameworks/R.framework/Versions/4.5-arm64/Resources/include", "R_TEXI2DVICMD=/opt/R/arm64/bin/texi2dvi", "JPE_DUCKDB=/Users/floswald/Dropbox/JPE/database/jpe.duckdb", "R_HOME=/Library/Frameworks/R.framework/Versions/4.5-arm64/Resources", "PYENV_ROOT=/Users/floswald/.pyenv", "SIGNATURE=/Users/floswald/signature.png", "OPENAI=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", "R_BZIPCMD=/usr/bin/bzip2", "GIT_TERMINAL_PROMPT=0", "SED=/usr/bin/sed", "JPE_GOOGLE_KEY=/Users/floswald/Dropbox/JPE/keys/analog-stage-459414-f2-be89612d0b81.json", "JPE_DBOX_APP_REFRESH=G7EqV3_EV7kAAAAAAAAAAaNuuaadk9x21-fH_gzI5KfCdWJemCRy95G7gc9uhi3g", "OPENBLAS_DEFAULT_NUM_THREADS=1", "GIT_TEMPLATE_DIR=/Users/floswald/.julia/artifacts/9a049d4b53ce75a92a831b451896c8c029234177/share/git-core/templates", "USER=floswald", "JL_DB_EJ=/Users/floswald/Dropbox/EJ", "JLL_DYLD_FALLBACK_LIBRARY_PATH=/Users/floswald/.julia/juliaup/julia-1.12.4+0.aarch64.apple.darwin14/lib/julia:/Users/floswald/.julia/artifacts/d017b9246247518792dcb16dae9af38dfb0c5eb6/lib:/Users/floswald/.julia/artifacts/b820a0a437e8501d06a17439abd84feaa5b6cca3/lib:/Users/floswald/.julia/juliaup/julia-1.12.4+0.aarch64.apple.darwin14/bin/../lib/julia:/Users/floswald/.julia/juliaup/julia-1.12.4+0.aarch64.apple.darwin14/bin/../lib", "JPE_DBOX=/Users/floswald/Dropbox/JPE", "DROPBOXSDK_ACCESS_TOKEN=/Users/floswald/.julia/config/dropbox/RES_token.JSON", "SHELL=/opt/homebrew/bin/fish", "NUVOLOS=3424-hfbGnwcSSUqaGUqcGr8Y2JYDeiL_rYQxRkO0zv92-gI", "TAR=/usr/bin/tar", "R_PLATFORM=aarch64-apple-darwin20", "JPE_DV=22f0a051-eef5-4460-a3f6-1ee9d642e76b", "TMPDIR=/var/folders/5q/yhcyv3z55wvg6lhgc3h22kk00000gq/T/", "R_LANDUSE=/Users/floswald/Downloads/package-submission/ReplicationPackage-submit", "DROPBOX_SECRETS=/Users/floswald/.julia/config/dropbox/RES_secrets.JSON", "DE_DB=sl.Bqeo5iiQ_CwWO_TdHUe1o8Hny7pSd7XVu_ZTfBe2SYPHkGM_Jwj8zmYOZp9_vGIOlr33pIXzYKD95144jFzN-77ZjJSNsyWfn_3maQIWq-GV5rLh5zm1fZx8whcTqWxwKZ9uV7e4RLnLEP0", "JPE_GMAIL_TOKEN=/Users/floswald/Dropbox/JPE/keys/gmail_tokens.json", "GIT_SSH_COMMAND=ssh -o \"BatchMode yes\"", "JPE_DBOX_APPS=/Users/floswald/Dropbox/Apps/JPE-packages", "R_QPDF=/Library/Frameworks/R.framework/Versions/4.5-arm64/Resources/bin/qpdf", "R_STRIP_SHARED_LIB=strip -x", "JULIA_DEBUG=Documenter", "TERM=xterm-256color", "HOME=/Users/floswald", "JPE_PACKAGES=/Users/floswald/Dropbox/Apps/JPE-packages", "R_STRIP_STATIC_LIB=strip -S", "XPC_FLAGS=0x0", "STATA_LICENSE_PATH=/Users/floswald/Dropbox/licenses/stata.lic", "XPC_SERVICE_NAME=0", "R_GZIPCMD=/usr/bin/gzip", "GIT_EXEC_PATH=/Users/floswald/.julia/artifacts/9a049d4b53ce75a92a831b451896c8c029234177/libexec/git-core", "DYLD_FALLBACK_LIBRARY_PATH=/Users/floswald/.julia/juliaup/julia-1.12.4+0.aarch64.apple.darwin14/lib/julia:/Users/floswald/.julia/artifacts/d017b9246247518792dcb16dae9af38dfb0c5eb6/lib:/Users/floswald/.julia/artifacts/b820a0a437e8501d06a17439abd84feaa5b6cca3/lib", "__CF_USER_TEXT_ENCODING=0x1F7:0x0:0x2", "R_GMAIL_ECTJ=/Users/floswald/git/EJData/gmail-clients/ECTJ/ectj.json", "CSL=/Users/floswald/git/styles", "LC_CTYPE=UTF-8", "MAKE=make", "__CFBundleIdentifier=com.apple.Terminal", "R_SESSION_TMPDIR=/var/folders/5q/yhcyv3z55wvg6lhgc3h22kk00000gq/T//RtmpMNoOZB", "RES_PROD=true", "JPE_GMAIL_CLIENT=/Users/floswald/Dropbox/JPE/keys/jpe-gmail-client.json", "OSTYPE=darwin24", "R_PAPERSIZE=a4", "PYENV_SHELL=fish", "SHLVL=1", "LOGNAME=floswald", "SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.RmYe6CDDgX/Listeners", "GUROBI_HOME=/Users/floswald/", "JPE_DBOX_APP=l5g60uc0i2yn2iw", "AUTOJUMP_SOURCED=1", "PAGER=/usr/bin/less", "SLACK_HOOK=https://hooks.slack.com/services/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", "R_RD4PDF=times,inconsolata,hyper", "R_DROPBOX=~/Dropbox/research", "TERM_PROGRAM_VERSION=455.1", "IPUMS_API_KEY=59cba10d8a5da536fc06b59d9ac7d661f42b412d8c7df88a21002e33", "R_LIBS_SITE=/Library/Frameworks/R.framework/Versions/4.5-arm64/Resources/site-library", "PWD=/Users/floswald/.julia/dev/PIIScanner.jl/docs", "DISPLAY=/private/tmp/com.apple.launchd.kgleEUFoek/org.xquartz:0", "JPE_DBOX_APP_SECRET=0b2zxcxogohm5ag", "TERM_PROGRAM=Apple_Terminal", "PYTHONPATH=/opt/homebrew/opt/python@3.10/", "R_ZIPCMD=/usr/bin/zip", "AUTOJUMP_ERROR_PATH=/Users/floswald/Library/autojump/errors.log", "TFL_KEY=b9a56830cac3473fb6d2ac63b2991f24", "DROPBOX_JPE=/Users/floswald/Dropbox/JPE", "JPE_DB=/Users/floswald/JPE", "TERM_SESSION_ID=8251582C-2882-45BA-8056-C0A2CC860ACF", "R_UNZIPCMD=/usr/bin/unzip", "R_BROWSER=/usr/bin/open", "R_DB_EJ=~/Dropbox/EJ", "ZENODO_READ=lxqSLNPJI8aKHSZ84o046IQnuUEl6ad1KSo9KS4aoy4vgxxcEkbCjWvwh8JY", "R_PRINTCMD=lpr", "R_SHARE_DIR=/Library/Frameworks/R.framework/Versions/4.5-arm64/Resources/share", "TIM_GDRIVE=/Users/floswald/Google Drive/My Drive/TIM", "R_DOC_DIR=/Library/Frameworks/R.framework/Versions/4.5-arm64/Resources/doc", "GIT_SSL_CAINFO=/Users/floswald/.julia/juliaup/julia-1.12.4+0.aarch64.apple.darwin14/share/julia/cert.pem", "JPE_DB_BACKUPS=/Users/floswald/Dropbox/JPE/database", "OPENBLAS_MAIN_FREE=1", "LN_S=ln -s"]; dir="/Users/floswald/.julia/dev/PIIScanner.jl/docs")
│   exception =
│    failed process: Process(setenv(`/Users/floswald/.julia/artifacts/9a049d4b53ce75a92a831b451896c8c029234177/bin/git remote show origin`,["PATH=/Users/floswald/.julia/artifacts/154306f0b5fcd9c59ee1d37c70553c8b8ab75ba4/bin:/Users/floswald/.julia/artifacts/9a049d4b53ce75a92a831b451896c8c029234177/bin:/Users/floswald/.julia/artifacts/3fa3ae5a55c864014d9c801405cb178ff567c9ea/bin:/Applications/google-cloud-sdk/bin:/opt/homebrew/Cellar/pyenv-virtualenv/1.2.4/shims:/Users/floswald/.pyenv/shims:/Users/floswald/.julia/bin:/Users/floswald/.local/share/gem/ruby/3.4.0/bin:/Applications/StataNow/StataMP.app/Contents/MacOS:/Users/floswald/.duckdb/cli/latest:/Applications/Stata/StataMP.app/Contents/MacOS:/opt/homebrew/opt/ruby/bin:/Users/floswald/.pixi/bin:/Applications/quarto/bin:/opt/homebrew/bin:/Users/floswald/.juliaup/bin:/usr/bin:/usr/local/bin:/Library/TeX/texbin:/bin:/usr/sbin:/System/Cryptexes/App/usr/bin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/opt/X11/bin:/Users/floswald/.orbstack/bin", "EDITOR=vi", "R_LIBS_USER=/Users/floswald/Library/R/arm64/4.5/library", "LETTER_TEMPLATES=/Users/floswald/Dropbox/supervision/templates", "EJ_DB=/Users/floswald/Dropbox/EJ", "R_PDFVIEWER=/usr/bin/open", "JPE_TOOLS_JL=/Users/floswald/git/JPEtools", "SLACK_FILES=xoxb-437685214404-1790526147312-1WvTgLis5nxrWaIOlacvfst6", "R_GMAIL_EJ=/Users/floswald/git/EJData/gmail-clients/EJ/ej.json", "PYENV_VIRTUALENV_INIT=1"  …  "R_DB_EJ=~/Dropbox/EJ", "ZENODO_READ=lxqSLNPJI8aKHSZ84o046IQnuUEl6ad1KSo9KS4aoy4vgxxcEkbCjWvwh8JY", "R_PRINTCMD=lpr", "R_SHARE_DIR=/Library/Frameworks/R.framework/Versions/4.5-arm64/Resources/share", "TIM_GDRIVE=/Users/floswald/Google Drive/My Drive/TIM", "R_DOC_DIR=/Library/Frameworks/R.framework/Versions/4.5-arm64/Resources/doc", "GIT_SSL_CAINFO=/Users/floswald/.julia/juliaup/julia-1.12.4+0.aarch64.apple.darwin14/share/julia/cert.pem", "JPE_DB_BACKUPS=/Users/floswald/Dropbox/JPE/database", "OPENBLAS_MAIN_FREE=1", "LN_S=ln -s"]; dir="/Users/floswald/.julia/dev/PIIScanner.jl/docs"), ProcessExited(128)) [128]
│    
│    Stacktrace:
│      [1] pipeline_error
│        @ ./process.jl:597 [inlined]
│      [2] read(cmd::Base.CmdRedirect)
│        @ Base ./process.jl:481
│      [3] read
│        @ ./process.jl:490 [inlined]
│      [4] git_remote_head_branch(varname::String, root::String; remotename::String, fallback::String)
│        @ Documenter ~/.julia/packages/Documenter/xvqbW/src/utilities/utilities.jl:678
│      [5] git_remote_head_branch
│        @ ~/.julia/packages/Documenter/xvqbW/src/utilities/utilities.jl:659 [inlined]
│      [6] Documenter.HTMLWriter.HTML()
│        @ Documenter.HTMLWriter ~/.julia/packages/Documenter/xvqbW/src/html/HTMLWriter.jl:507
│      [7] top-level scope
│        @ ~/.julia/dev/PIIScanner.jl/docs/make.jl:3
│      [8] include(mod::Module, _path::String)
│        @ Base ./Base.jl:306
│      [9] exec_options(opts::Base.JLOptions)
│        @ Base ./client.jl:317
│     [10] _start()
│        @ Base ./client.jl:550
│   stderr = "dyld[90809]: Library not loaded: @rpath/libcrypto.3.dylib\n  Referenced from: <4C4C44BD-5555-3144-A1F5-00E5742482C4> /Users/floswald/.julia/artifacts/3fa3ae5a55c864014d9c801405cb178ff567c9ea/bin/ssh\n  Reason: tried: '/Users/floswald/.julia/artifacts/3fa3ae5a55c864014d9c801405cb178ff567c9ea/bin/../lib/libcrypto.3.dylib' (no such file), '/Users/floswald/.julia/artifacts/3fa3ae5a55c864014d9c801405cb178ff567c9ea/bin/../lib/libcrypto.3.dylib' (no such file), '/usr/local/lib/libcrypto.3.dylib' (no such file), '/usr/lib/libcrypto.3.dylib' (no such file, not in dyld cache)\nfatal: Could not read from remote repository.\n\nPlease make sure you have the correct access rights\nand the repository exists.\n"
└ @ Documenter ~/.julia/packages/Documenter/xvqbW/src/utilities/utilities.jl:685
┌ Debug: interpret_repo_and_remotes
│   remotes_checked = Documenter.RemoteRepository[]
│   repo_normalized = Documenter.Remotes.GitHub("floswald", "PIIScanner.jl")
│   makedocs_root_remoteref = nothing
│   makedocs_root_repo = "/Users/floswald/.julia/dev/PIIScanner.jl"
│   makedocs_root_remote = Documenter.Remotes.GitHub("floswald", "PIIScanner.jl")
└ @ Documenter ~/.julia/packages/Documenter/xvqbW/src/documents.jl:604
┌ Debug: Remotes: using automatically determined remote
│   makedocs_root_remoteref = nothing
│   makedocs_root_repo = "/Users/floswald/.julia/dev/PIIScanner.jl"
│   makedocs_root_remote = Documenter.Remotes.GitHub("floswald", "PIIScanner.jl")
│   repo_normalized = Documenter.Remotes.GitHub("floswald", "PIIScanner.jl")
└ @ Documenter ~/.julia/packages/Documenter/xvqbW/src/documents.jl:669
┌ Debug: Document: remotes
│   remote = Documenter.Remotes.GitHub("floswald", "PIIScanner.jl")
│   remotes =
│    1-element Vector{Documenter.RemoteRepository}:
│     Documenter.RemoteRepository("/Users/floswald/.julia/dev/PIIScanner.jl", Documenter.Remotes.GitHub("floswald", "PIIScanner.jl"), "df74c7b917e5c142eabff44a1d4a2696782f6b96")
└ @ Documenter ~/.julia/packages/Documenter/xvqbW/src/documents.jl:462
[ Info: SetupBuildDirectory: setting up build directory.
[ Info: Doctest: running doctests.
┌ Debug: Running doctests.

Because it’s running a bundled git provided by the Git package. Normally this is a more robust option than relying on a system provided git, which might be very old or not exist at all.

In this case it’s obviously the opposite, which potentially could be caused by an old version of the Git package in your environment. What version of Git does

pkg> status -m

report?

Specifically this could be a manifestation of https://github.com/JuliaVersionControl/Git.jl/issues/40, which was fixed three years ago in version 1.3.0 of the Git package.

But if the used version is newer, this hypothesis falls.

that’s

[d7ba0133] Git v1.5.0

So that’s the current version. Let’s see if this is reproducible without Documenter. Does

using Git: git
run(`$(git()) remote show origin`)

give the same error?

works like you did but not via Documenter:

floswald@PTL11077 ~/.j/d/P/docs (main)> julia --project
               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.12.4 (2026-01-06)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org release
|__/                   |

julia> using Git: git

julia> run(`$(git()) remote show origin`)
* remote origin
  Fetch URL: git@github.com:floswald/PIIScanner.jl.git
  Push  URL: git@github.com:floswald/PIIScanner.jl.git
  HEAD branch: main
  Remote branch:
    main tracked
  Local branch configured for 'git pull':
    main merges with remote main
  Local ref configured for 'git push':
    main pushes to main (up to date)
Process(setenv(`/Users/floswald/.julia/artifacts/9a049d4b53ce75a92a831b451896c8c029234177/bin/git remote show origin`,["PATH=/Users/floswald/.julia/artifacts/154306f0b5fcd9c59ee1d37c70553c8b8ab75ba4/bin:/Users/floswald/.julia/artifacts/9a049d4b53ce75a92a831b451896c8c029234177/bin:/Users/floswald/.julia/artifacts/3fa3ae5a55c864014d9c801405cb178ff567c9ea/bin:/Applications/google-cloud-sdk/bin:/opt/homebrew/Cellar/pyenv-virtualenv/1.2.4/shims:/Users/floswald/.pyenv/shims:/Users/floswald/.julia/bin:/Users/floswald/.local/share/gem/ruby/3.4.0/bin:/Applications/StataNow/StataMP.app/Contents/MacOS:/Users/floswald/.duckdb/cli/latest:/Applications/Stata/StataMP.app/Contents/MacOS:/opt/homebrew/opt/ruby/bin:/Users/floswald/.pixi/bin:/Applications/quarto/bin:/opt/homebrew/bin:/Users/floswald/.juliaup/bin:/usr/bin:/usr/local/bin:/Library/TeX/texbin:/bin:/usr/sbin:/System/Cryptexes/App/usr/bin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/opt/X11/bin:/Users/floswald/.orbstack/bin", "LETTER_TEMPLATES=/Users/floswald/Dropbox/supervision/templates", "EJ_DB=/Users/floswald/Dropbox/EJ", "SLACK_FILES=xoxb-437685214404-1790526147312-1WvTgLis5nxrWaIOlacvfst6", "JPE_TOOLS_JL=/Users/floswald/git/JPEtools", "PYENV_VIRTUALENV_INIT=1", "JPE_DUCKDB=/Users/floswald/Dropbox/JPE/database/jpe.duckdb", "PYENV_ROOT=/Users/floswald/.pyenv", "SIGNATURE=/Users/floswald/signature.png", "OPENAI=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"  …  "TERM_PROGRAM=Apple_Terminal", "PYTHONPATH=/opt/homebrew/opt/python@3.10/", "AUTOJUMP_ERROR_PATH=/Users/floswald/Library/autojump/errors.log", "DROPBOX_JPE=/Users/floswald/Dropbox/JPE", "JPE_DB=/Users/floswald/JPE", "TERM_SESSION_ID=8251582C-2882-45BA-8056-C0A2CC860ACF", "ZENODO_READ=lxqSLNPJI8aKHSZ84o046IQnuUEl6ad1KSo9KS4aoy4vgxxcEkbCjWvwh8JY", "GIT_SSL_CAINFO=/Users/floswald/.julia/juliaup/julia-1.12.4+0.aarch64.apple.darwin14/share/julia/cert.pem", "JPE_DB_BACKUPS=/Users/floswald/Dropbox/JPE/database", "OPENBLAS_MAIN_FREE=1"]), ProcessExited(0))

julia> exit()
floswald@PTL11077 ~/.j/d/P/docs (main)> julia --project make.jl
┌ Warning: Unable to determine HTML(edit_link = ...) from remote HEAD branch, defaulting to "master".
│ Calling `git remote` failed with an exception. Set JULIA_DEBUG=Documenter to see the error.
│ Unless this is due to a configuration error, the relevant variable should be set explicitly.
└ @ Documenter ~/.julia/packages/Documenter/xvqbW/src/utilities/utilities.jl:680

And you are entirely certain that you have the same Git version in the environment where you run Documenter? The Documenter code is a little more involved but doesn’t seem to do anything dramatically different. Though you could try calling

Documenter.git_remote_head_branch("", dirpath)

directly to see whether that gives the error.

I’m a bit confused with the environment setup following the documentation to be honest, so I’m afraid that’s where my mistake lies. Look at this:

floswald@PTL11077 ~/.j/d/P/docs (main)> tree -L 1
.
├── Project.toml
├── build
├── make.jl
└── src

3 directories, 2 files
floswald@PTL11077 ~/.j/d/P/docs (main)> julia --project
               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.12.4 (2026-01-06)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org release
|__/                   |

julia> using Documenter

julia> Documenter.git_remote_head_branch("", "..")
┌ Warning: Unable to determine  from remote HEAD branch, defaulting to "master".
│ Calling `git remote` failed with an exception. Set JULIA_DEBUG=Documenter to see the error.
│ Unless this is due to a configuration error, the relevant variable should be set explicitly.
└ @ Documenter ~/.julia/packages/Documenter/xvqbW/src/utilities/utilities.jl:680
"master"

julia> using Git: git

julia> run(`$(Git.git()) remote`)
ERROR: UndefVarError: `Git` not defined in `Main`
Suggestion: check for spelling errors or missing imports.
Hint: Git is loaded but not imported in the active module Main.
Stacktrace:
 [1] top-level scope
   @ REPL[4]:1

julia> run(`$(git()) remote`)
origin

I’m out of guesses and don’t have a Mac to experiment on, so it would be good to get input from someone who does. You probably should try to make a minimal reproducer and file an issue with Documenter. It seems surprising that this would have flown under the radar for a long time but maybe most people run Documenter on Linux CI.

I agree - very surprising. I’m afraid I’m doing something stupid here. Will supply MWE. Thanks for your help!