开发者

How can I get the source code of a file from GitWeb?

开发者 https://www.devze.com 2023-03-09 13:19 出处:网络
I want to download (via curl or AJAX) the HEAD revision of a file in a Git repository. GitWeb is already installed.

I want to download (via curl or AJAX) the HEAD revision of a file in a Git repository. GitWeb is already installed.

I can get the formatted source code: http://server1.local/?p=Project&a=blob&f=Path/To/File.html

However, this does not seem to work when I use blob_plain a开发者_JS百科s the value for "a"; blob_plain requires a hash in a "h" parameter - but I want to refer to the newest version of the file, not a specific one.

Is there something that needs to be configured? Am I using the right URL schema?


Which gitweb version?

Because it works for me. When I can access

http://localhost/cgi-bin/gitweb.cgi/git.git?a=blob;f=builtin/annotate.c

i can also access

http://localhost/cgi-bin/gitweb.cgi/git.git?a=blob_plain;f=builtin/annotate.c



You can always try to give HEAD as argument to 'hb', i.e.

http://server1.local/?p=Project&a=blob&f=Path/To/File.html&hb=HEAD
0

精彩评论

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

关注公众号