Introducing git/fs: A native git client for Plan 9

0
1394
2 min read

On Wednesday, Ori Bernstein, a software engineer at Google, shared details about the Git client he has implemented for Plan 9, a non-posix system. The client named git/fs is implemented in Plan 9 flavor C and comes with tools for writing repository contents.

Why git/fs is being introduced?

This is the first time someone has implemented a Git client for Plan 9. The upstream Git uses a large number of system calls that are not supported in Plan 9. Bernstein came up with this client to enable working with git repositories without having to clone the git interface directly.

Git/fs structure

Git/fs provides read-only access to scripts via a file system mounted on ‘/mnt/git’. You will find the following content in ‘/mnt/git’:

  • /mnt/git/object: This includes the objects in the repo.
  • /mnt/git/branch: This includes the branches in the repo.
  • /mnt/git/ctl: This is a file showing the status of the repo.
  • /mnt/git/HEAD: This is an alias for the currently checked out commit directory.

You can directly access the repository from the shell using standard tools. The scripts and binaries will manipulate the repository contents directly and the changes done will be immediately mirrored in the filesystem. To improve user experience, the author has put more focus on building a consistent and minimalist interface that supports the necessary functionality.


Git/fs does not have any concept of the staging area. There are only three states that files can be in namely, ‘untracked’, ‘dirty’, and ‘committed’. To do the tracking it uses empty files under .git/index9/{removed,tracked}/path/to/file.

The client is currently hosted in Mercurial, a distributed revision-control tool, as it is the current native plan 9 version control system.

To know more detail about Git/fs, head over to its Bitbucket repository.

Read Next

Chris Dickinson on how to implement Git in Rust

‘Developers’ lives matter’: Chinese developers protest over the “996 work schedule” on GitHub

Sublime Text 3.2 released with Git integration, improved themes, editor control and much more!