Issue
Is it possible to change the ssh user temporarly for a "git push remote master" without messing up with .git/config or "git remote", or using the whole remote url?
[root@host gitrepo]# git push otheruser@remote master # this does not work, but how great it would be
[root@host gitrepo]# USER=otheruser git push remote master # still asks password for root
Solution
Have you tried using the whole remote URL?
git push ssh://<temp_user>@<host>/<repo_path> <local_branch>:<remote_branch>
and you will be prompted to provide the password
Answered By - laplasz Answer Checked By - David Goodson (WPSolving Volunteer)