1) gitdir=$(git rev-parse --git-dir);
2) scp -p -P 29418 <username>@gerrit.xyz.se:hooks/commit-msg ${gitdir}/hooks/
a) I don't know how to execute step 1 in windows so skipped it and used hardcoded path in step 2 scp -p -P 29418 <username>@gerrit.xyz.se:hooks/commit-msg .git/hooks/
b) In case you get below error, manually create "hooks" directory in .git folder
protocol error: expected control record
c) if you have submodule let's say "XX" then you need to repeat step 2 there as well and this time replace ${gitdir} with that submodules path
d) In case scp is not recognized by windows give full path of scp
"C:\Program Files\Git\usr\bin\scp.exe"
e) .git folder is present in your project repo and it's hidden folder