diff --git a/src/core/output.jl b/src/core/output.jl
index 2ff725c11f3137a16c94c14a9dba730f82237066..abb18df80f0c99084cf917ddd6213dfe13e74938 100644
--- a/src/core/output.jl
+++ b/src/core/output.jl
@@ -102,9 +102,12 @@ function saveinputfiles(model::SimulationModel)
         # Record the current git commit and versions of dependencies for reproducibility
         println(f, "# with Persefone $(pkgversion(Persefone)), git commit $(currentcommit),")
         println(f, "# running on Julia $(VERSION).\n#\n")
-        if !isempty(strip(read(`git status -s`, String)))
-            println(f, "# WARNING: Your repository contains uncommitted changes. This may")
-            println(f, "#          compromise the reproducibility of this simulation run.\n")
+        try # if this is loaded as a package, the directory may not be a git repo
+            if !isempty(strip(read(`git status -s`, String)))
+                println(f, "# WARNING: Your repository contains uncommitted changes. This may")
+                println(f, "#          compromise the reproducibility of this simulation run.\n")
+            end
+        catch
         end
         TOML.print(f, prepareTOML(deepcopy(model.settings)))
     end