firstly, git must be installed

But when when git pull/push towards the windows, you may get error:

The term 'git-receive-pack' is not recognized as a name of a cmdlet, function, script file, or executable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

(e.g. if git is installed via scoop)

In this case, all you need is just:

Scoop’s Git build sometimes doesn’t install separate helper exes like git-upload-pack into a libexec folder, but git.exe itself supports the upload-pack/receive-pack subcommand — easiest fix is to add a small shim named git-upload/receive-pack.* on the server PATH that forwards to git.exe upload-pack.

Assuming $env:SCOOP is your scoop home path.

Run in PowerShell on the server (adjust if your shims path differs):

$git=(Get-Command git).Source
$shimdir="$env:SCOOP\\shims"

function f() {
  param ($x)
  echo "@echo off`n"$git" $x %*" | Out-File "$shimdir\\git-$x.cmd"
}

f "upload-pack"
f "receive-pack"

restart sshd via:

Restart-Service sshd

alternatively install the official Git-for-Windows package which includes git-upload-pack.exe.