Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 91 lines (53 sloc) 1.901 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90

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 # Debian
    sudo pacman -S omake ocamlfuse-cvs pcre-ocaml ocaml-batteries # Arch
    sudo yum install fuse-devel ocaml-pcre-devel ocaml-findlib-devel ocaml-camomile ocaml-camlidl ocaml-bisect ocaml-ounit ocaml-ocamldoc # Fedora

Build:

    git submodule update --init
    make -C deps/ocamlfuse/lib || make -C deps/ocamlfuse/lib byte-code-library
    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.