在不干扰.git/config或"git remote",或使用整个远程URL的情况下,是否可以临时更改ssh用户以进行"git push remote master"操作?
[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
GIT_SSH_COMMAND
https://dev59.com/KGYq5IYBdhLWcg3wwDRA#27607760 - Ben Creasy