How to run git command remotely?

2019-09-25 03:59发布

问题:

How to run git command on remote computer? I want to run git show or git log on remote computer. how to run command similar to subversion? what is your solution? Update: For example I have a server that can connect to it by ssh or over http protocol and my source code saved on that server. I want to access to change set detail programmatically by ruby via git command without cloning.

回答1:

If you literally want to run the command remotely, do it over SSH:

ssh username@host "cd my/repo/path && git show"