Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/20.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
给定svn分支/修订版,GitHub能告诉我sha吗?_Git_Svn_Github - Fatal编程技术网

给定svn分支/修订版,GitHub能告诉我sha吗?

给定svn分支/修订版,GitHub能告诉我sha吗?,git,svn,github,Git,Svn,Github,我的一个“遗留”系统使用svn(例如svnco)从GitHub检出代码 是否有GitHub API(或命令)可用于将svn分支/修订版映射回Git sha 我知道git svn和find rev,但据我所知,您首先执行“git svn克隆…”,然后执行“git svn find rev…”。我不想为了查看修订版而签出整个回购协议。正如zerkms已经评论的那样,您可以使用“git ls remote”来实现: git ls-remote <remote> 只给你远程分支“主”的sh

我的一个“遗留”系统使用svn(例如svnco)从GitHub检出代码

是否有GitHub API(或命令)可用于将svn分支/修订版映射回Git sha


我知道git svn和find rev,但据我所知,您首先执行“git svn克隆…”,然后执行“git svn find rev…”。我不想为了查看修订版而签出整个回购协议。

正如zerkms已经评论的那样,您可以使用“git ls remote”来实现:

git ls-remote <remote>
只给你远程分支“主”的sha

此外,有关更多信息,请查看git ls remote的手册:

man git-ls-remote

我在这里找到了答案

总之,您可以这样做

$ svn propget git-commit --revprop -r 1000 https://github.com/rails/rails/trunk
480150e5fb73f1a6a23bb08fdf9a537ccbd6f60d
$ svn propget git-commit --revprop -r 1000 https://github.com/rails/rails/trunk
480150e5fb73f1a6a23bb08fdf9a537ccbd6f60d