开发者

Git - Get file blob by tree location not by sha

开发者 https://www.devze.com 2023-04-06 09:30 出处:网络
I\'m trying to use GitHub\'s API to retrieve the blob of a file. I know I could start at the master and run through the entire tree, grabbing commit SHA\'s, until I make a match to the path I want, bu

I'm trying to use GitHub's API to retrieve the blob of a file. I know I could start at the master and run through the entire tree, grabbing commit SHA's, until I make a match to the path I want, but that seems like so many queries and so much overhead.

开发者_如何学Python

Is it possible to pass in something to git like "master/folder/file.txt" and get the blob information in one query?

I just want to display the most recent version of the file in the master branch.

This is what I'm looking at: http://developer.github.com/v3/git/ I just don't know where I should be looking. I'm running through the book now trying to find something.


It's very simple when using Github I found out.

You just need to query the raw.github.com instead of api.github.com

https://raw.github.com/senica/Booger/master/admin/admin.php

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号