 
   defp do_checkout(opts) do
     ref = get_lock_rev(opts[:lock]) || get_opts_rev(opts)
-    run_cmd_or_raise "git --git-dir=.git checkout --quiet #{ref}"
+    run_cmd_or_raise("git", ["--git-dir=.git", "checkout", "--quiet", ref])
 
     if opts[:submodules] do
-      run_cmd_or_raise "git --git-dir=.git submodule update --init --recursive"
+      run_cmd_or_raise("git", ["--git-dir=.git" , "submodule", "update", "--init", "--recursive"])
     end
 
     get_lock(opts)

    location = opts[:git]

    _ = File.rm_rf!(path)
    command  = ~s(git clone --no-checkout --progress "#{location}" "#{path}")

    run_cmd_or_raise(command)
    File.cd! path, fn -> do_checkout(opts) end
  end


        version
      :error ->
        version = 
          run_system("git", ["--version"])
          |> parse_version

        Mix.State.put(:git_version, version)
