如何使用类似curl的命令获取远程回购的最后一个提交ID? [英] How to get the last commit ID of a remote repo using curl-like command?
本文介绍了如何使用类似curl的命令获取远程回购的最后一个提交ID?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
$ b
命令 git rev-解析HEAD
适用于本地克隆的git仓库,但我想通过CURL命令从原始GIT仓库中获取它。
例如:我想获取git URL的最后一个提交ID https://git.appfactorypreview.wso2.com/history/apiapp.git/ 。
如何?
解决方案
试试这个命令
git log - format =%H-n 1
I want to get the last commit ID of the remote git repo.
The command git rev-parse HEAD
works for a locally-cloned git repo, but I want to get it from the original GIT repo by a CURL command or so.
Eg: I want to get the last commit ID of the git URL https://git.appfactorypreview.wso2.com/history/apiapp.git/.
How?
解决方案
try this command
git log --format="%H" -n 1
这篇关于如何使用类似curl的命令获取远程回购的最后一个提交ID?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文