I'm researching the idea of building a super-small (preferably PHP) web app, which will serve (among other things) as a minimal front-end to a git repository.
Any library/article for reading a git repository (".git" folder) without having to execute the "git" process? I'm looking for an API to manage a git repository. I'm only interested in basic functions, such as reading last commits (name of commiter, commit note, date), displaying and traversing branches...
Thanks, ANaimi
You can list all references on remote with "git ls-remote <URL>". "git archive --remote=<URL> HEAD". "git clone --depth=1 <URL>". If server provides git web interface to repository, you can use it to browse.
The Git Show command allows us to view files as they existed in a previous state. The version can be a commit ID, tag, or even a branch name. The file must be the path to a file. For example, the following would output a contents of a file named internal/example/module.go file from a tagged commit called “release-23”.
Degit is a tool created by Rich Harris, the creator of Svelte and Rollup, which he uses to quickly create a new project by cloning a repository without keeping the git folder. But it can also be used to clone any repo once...
From GitExtension, open your repository, then you can open git bash and do what you want. Or, start git bash, then cd to the directory where your code is (at the top level), but, I find it easier to just start with GitExtension so I don't have to think about what I had typed as the top of my src.
Would this (git API documents) be of any help?
Here's a list of resources about extending php (i.e. to to provide wrappers around other library code):
Also, these would seem relevant, too:
You may also want to check out the Cgit project since they've done something similar (except they build their own git library -- also to avoid running git
directly).
There's JGit, a pure Java implementation, that may be useful to you.
Try also glip, a pure php implementation of git, which was extracted from eWiki.
I think that best start in such case could be Interfaces Frontends And Tools page on Git Wiki.
You can find there link to eWiki (github) which supposedly uses native (in PHP) access to Git.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With