This is Git question rather than WinSCP question. Consider asking of Stack Overflow or similar site. Please, post a link here if you do.
Before posting, please read how to report bug or request support effectively.
Bug reports without an attached log file are usually useless.
It should work. But I wouldn't do it.
git pushover SSH git remote, instead of WinSCP?