title: Git command run with child_process.spawn is unable to find git-lfs subcommand
body: <p>I've got an electron app (Electron v17.4.10) running on macOS Monterey (v12.5) and on startup it attempts to perform the command <code>git lfs install</code>. It does so by using the Node child_process package's spawn command to invoke a direct call to a standalone git executable.</p>
  <p>When the electron app is installed, it provides its own version of git that isn't added to the PATH to prevent interfering with any git versions that may already be installed. The standalone version of git (v2.33.0) has the folder structure shown in the image below and the git-lfs binary (v3.2.0) is contained within <code>/PortableGit/git/libexec/git-core/</code></p>
  <p><a href="https://i.stack.imgur.com/kjGiy.png" rel="nofollow noreferrer">Standalone Git Directory Structure</a></p>
  <p>The full command executed is:<br>
  <code>&quot;/Applications/MyApp/Utilities/PortableGit/bin/git&quot; lfs install</code></p>
  <p>And the output is:<br></p>
  <pre><code>git: 'lfs' is not a git command. See 'git --help'.
  
  The most similar command is
      log
  </code></pre>
  <p>How can I get the standalone installation of git to recognize the subcommand <code>lfs</code> without placing it on the PATH? Is having a self-contained git package like I've described even possible? Or should I abandon the approach and ensure git is installed properly on the target machine?</p>