In my case, from GIT windows to a remote GIT on pi raspberry server, using this command:
GIT_SSH_COMMAND="ssh -p 22" git push origin master
instead of
git push origin master
solved the problem