I have a script called 'git-export' which helps me to export a remote repository. It is run like that:
git-export http://host.com/git-repo <-t tag or -b branch or -c commit> /local/dir
Before it was used to export local repository and I used these commands:
to get commit from branch:
git branch -v --no-abbrev|awk '($1=="'$BRANCH'") || ($1 == "*" && $2 == "'$BRANCH'"){if($1 == "*"){print $3;}else{print $2;}}'
or
git rev-parse -q --verify $BRANCH^{commit}
to get commit by tag:
git rev-parse -q --verify $TAG^{commit}
also I have scripts to list tags, versions (tags, starting with v), I use git branch -v to show branches....
Question is: How can I do these things on remote repository without having local. Is there some general way to query remote. For example: git --remote=http://host.com/repo branch -v
or git --remote=http://host.com/repo log
Resion: If I want to install software on remote host I just want to
- list versions, branches, etc
- export specific version/branch/commit and show SHA1 of the commit regardless which one of these I export (by export I mean
git archive --remote=<repo>|tar x
)
edit:
I don't want to actionalyl run the commands on remote. I want to use the remote repository with local commands and display it formatted.