Mur*_*ala 36 git bash git-stash
是否有可能在没有git clone的情况下获取远程git repo的提交日志/消息?
我正在使用的git repo非常庞大,即使我使用--depth = 1运行git clone仍然需要一段时间才能克隆它.
我在找这样的东西,
git remote-log.
我也查看了git -ls-remote,它只提供SHA和Heads /标签.我有兴趣获得最后2个提交标题,提交用户并提交SHA?
谁知道怎么做?
小智 16
如果您希望查看分支的最后几个提交,请尝试:
git clone -b [branch name] --single-branch [repo url] --depth=3
Run Code Online (Sandbox Code Playgroud)
这将仅克隆您感兴趣的分支上的最后3个提交.完成后,您可以进入克隆的回购并查看历史记录.
aus*_*ust 13
没有git log本地(克隆)副本就无法查看远程日志.您将需要克隆存储库然后执行您想要的操作.克隆后,您可以获取不同的遥控器并执行操作git log <remote>/<branch>.另一种方法是在服务器上使用软件,允许您通过某种类型的服务(如Stash,GitHub Enterprise等)查看远程git历史记录.
请参阅远程存储库上的提交历史
如果您想了解更多信息,这是一个很好的资源:http://git-scm.com/book/en/Git-Basics-Viewing-the-Commit-History
小智 6
不是确切的,而是一种方式.
使用GitHub Developer API
1. Opening this will get you the recent commits.
https://api.github.com/repos/learningequality/ka-lite/commits
You can get the specific commit details by attaching the commit hash in the end of above url.
2. All the files ( You need sha for the main tree)
https://api.github.com/repos/learningequality/ka-lite/git/trees/7b698a988683b161bdcd48a949b01e2b336b4c01
Run Code Online (Sandbox Code Playgroud)
我希望这可能有所帮助.