如何在远程仓库上运行GIT命令 [英] How to run GIT commands on remote repository

查看:149
本文介绍了如何在远程仓库上运行GIT命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图编写一个简单的PHP应用程序,它将使用终端命令从远程Git存储库检索一些信息。我不想创建本地工作副本或存储库。我只想从远程仓库(浏览树,提交历史,文件差异,下载文件)中读取信息,因此它将是只读连接。

I am trying to code an simple PHP application which will retrieve some information from the remote Git repositories with terminal commands. I do not want to create a local working copy or repository. I only want to read information from remote repositories (browse tree, commit history, file diffs, download file), so it will be a read only connection.

要做的是运行一系列简单的命令像SVN中的那些:log,ls,diff,cat,..

What I need to do is to run a series of simple commands like those in SVN: log, ls, diff, cat,..

我已经为SVN做了,简单。通常命令类似于以下格式:

I have allready done that for SVN and it was easy. Usually commands were similar to this format:

svn --user myusername --pass mypassword --non-interactive command -r revisionNumber urlToRemoteRepository

我的问题是如何使用终端命令从Git仓库获取类似的信息?

My question is how to get similar information from Git repositories with terminal commands only?

非常感谢你。

推荐答案

PuTTY(windows)或ssh命令(Mac / Linux),并从命令行运行它们。

I would SSH into the server using PuTTY (windows) or the ssh command (Mac/Linux) and run them from the command line there.

这篇关于如何在远程仓库上运行GIT命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆