Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Reading a Git repository, without Git

Tags:

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

like image 423
ANaimi Avatar asked Mar 14 '09 12:03

ANaimi


People also ask

How do I explore a git repository?

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.

How do I see files in a git repository?

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”.

Can I clone a repo without git?

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...

How do I open a git repository in CMD?

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.


4 Answers

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):

  • extending php - an overview
  • writing php extension modules in C
  • PHP extension writing
  • writing extensions
  • Practical PHP Programming:Writing extensions
  • Extending PHP: examples
  • Writing a PHP Extension
  • Extension Writing Part I: Introduction to PHP and Zend
  • Zend API: Hacking the Core of PHP
  • PHP at the Core: A Hacker's Guide to the Zend Engine
  • Creating a PHP5 Extension with MS VC++ 2005
  • Writing a PHP Extension (C++)

Also, these would seem relevant, too:

  • git-php
  • git library?
  • Pure-Python Git Library
  • Git library?
  • libgit2 - a true git library & libgit2 source code at GitHub
  • php-git, a libgit2 binding
  • ActionScript3 git library
like image 167
none Avatar answered Sep 24 '22 01:09

none


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.

like image 31
Pat Notz Avatar answered Sep 26 '22 01:09

Pat Notz


Try also glip, a pure php implementation of git, which was extracted from eWiki.

like image 31
Cesare D'Amico Avatar answered Sep 23 '22 01:09

Cesare D'Amico


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.

like image 45
Jakub Narębski Avatar answered Sep 25 '22 01:09

Jakub Narębski