Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
A filesystem interface to git repositories
OCaml C Shell
tree: 179a8cafa8

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
build
debug
deps
doc
profile
src
subprocess
.gitignore
LICENSE
OMakefile
OMakeroot
README
README.md
git-fs

README.md

git-fs

git-fs is a filesystem interface to git repositories.

Past and current versions can be accessed without a checkout. Heads, tags, branches, reflogs, commits and worktrees provide various means of naming and accessing files.

Use cases

You can try these on the git.git repository.

Compute repository statistics

How much code in the first major release?

git fs
cd .git/fs/tags/v1.0.0/worktree
ohcount # A sloccount alternative

Display the latest html docs

git fs; cd .git/fs
firefox remotes/origin/html/worktree/index.html

Jump to a commit using its SHA1

git fs; cd .git/fs
cd commits/902f235378cb2b2f6dd5dd664b9630c95321f0ae

etc.

  • Restore from backup (bup, gibak)
  • Look at previous conffiles stored in etckeeper
  • Look at wiki pages stored by ikiwiki or gh-pages
  • Serve repository snapshots using a standard webserver.

Build instructions

git-fs depends on FUSE and some OCaml libraries. It has been tested on Debian, Ubuntu, and ArchLinux.

Get the dependencies:

sudo aptitude install omake libfuse-dev camlidl libpcre-ocaml-dev libbatteries-ocaml-dev
sudo pacman -S omake ocamlfuse-cvs pcre-ocaml ocaml-batteries

Get ocamlfuse from source; use the CVS version which fixes some GC errors.

curl 'http://ocamlfuse.cvs.sourceforge.net/viewvc/ocamlfuse/?view=tar' |gunzip > ocamlfuse.tar
echo 'e55ba7fc9f02035068efb97b86ea42449d25e4a745563f46215591df9e9ab149  ocamlfuse.tar' |sha256sum -c

Unpack ocamlfuse to a folder called (or symlinked) deps/ocamlfuse.

Build:

make -C deps/ocamlfuse/lib
omake

Install (~/bin must be in your path):

ln -s ~+/git-fs -t ~/bin

Usage

The first step is to mount the filesystem.

git fs

Then, either browse it

cd .git/fs/HEAD/worktree
cat README

Or use a few special commands

git fs mtab
git fs umount
git fs help

Debugging

MALLOC_CHECK_=3 debug/git-fs debug 2>&1 |tee -a debug.log
Something went wrong with that request. Please try again.