How to run git command remotely?

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?
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.

  • Is there any way to get git to work directly with a .pac (proxy auto-config) script?
  • How to git fetch another branch after cloning a single branch
  • Export every revision of a single file from a Git repository?
  • How to use Github with Xcode4's version control
  • REJECTED_NONFASTFORWARD error in git remote push Netbeans
  • Max file size and max repository size in Git?
  • Run testng test in Git pre-commit hook
  • Set up git to pull and push all branches
  • Why the same git script is producing different hashes?
  • Github, git, how to submit changes to an upstream repo
  • TortoiseGit fatal : can not hash , permission error
  • Git pulled from wrong branch
  • One Solution collect form web for “How to run git command remotely?”

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

    ssh username@host "cd my/repo/path && git show"
    Git Baby is a git and github fan, let's start git clone.