You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Sebastian Thiel 4c06f7ba66
2 months ago
.cargo Add release configuration for maximum performance + native CPU features 12 months ago
.github And put FUNDING into the right spot :D 3 months ago
.gov Remove timesheet, move it to Byron/byron/timesheets/gitoxide.csv 3 months ago
ci add ci/ dir with everything copied from dua 12 months ago
etc Slim down git-config with cargo-diet 3 months ago
experiments More efficient organization of experiments in workspace (#63) 2 months ago
git-commitgraph (cargo-release) version 0.3.2 4 months ago
git-config Thank cargo-doc 3 months ago
git-features refactor 3 months ago
git-hash (cargo-release) version 0.1.2 5 months ago
git-index remove dash in all repository links 9 months ago
git-object thanks clippy 3 months ago
git-odb git-odb: add link to simplified/polonius version in the docs 2 months ago
git-packetline (cargo-release) version 0.9.0 3 months ago
git-protocol (cargo-release) version 0.5.0 3 months ago
git-ref (cargo-release) version 0.4.1 6 months ago
git-repository refactor 3 months ago
git-transport (cargo-release) version 0.6.0 3 months ago
git-tui remove dash in all repository links 9 months ago
git-url (cargo-release) version 0.3.0 3 months ago
gitoxide-core Remove locate(…) -> Option<Result<…>> in favor of Result<Option<…>> 2 months ago
src Ensured linter checks pass 3 months ago
tests Add journey test 3 months ago
.editorconfig Initial commit - based on standard project template 3 years ago
.gitignore Add stress tests for `gixp commit-graph-verify` command. 8 months ago Update changelog with new releases 6 months ago Create 2 months ago
Cargo.lock More efficient organization of experiments in workspace (#63) 2 months ago
Cargo.toml Set resolver = "2" in toml file(#56) 2 months ago refactor 10 months ago
LICENSE-APACHE Allow dual-licensing with Apache 2.0 10 months ago
LICENSE-MIT remove dash in all repository links 9 months ago
Makefile More efficient organization of experiments in workspace (#63) 2 months ago Collaboration and contribution instructions 2 months ago First draft on additional features/focus points extracted from discussion 3 months ago typo 3 months ago
rustfmt.toml Allow for more screen space when formatting 12 months ago Update goals and non-goals to not make them appear 'fixed' forever 3 months ago


gix is a command-line interface (CLI) to access git repositories. It's written to optimize the user-experience, and perform as good or better than the canonical implementation.

Furthermore it provides an easy and safe to use API in the form of various small crates for implementing your own tools in a breeze. Please see 'Development Status' for a listing of all crates and their capabilities.


Development Status

gitoxide (CLI)

  • please note that all functionality comes from the gitoxide-core library, which mirrors these capabilities and itself relies on all git-* crates.
  • limit amount of threads used in operations that support it.
  • choose between 'human' and 'json' output formats
  • the gix program - convenient and for humans
    • init - initialize a new non-bare repository with a main branch
    • organize - find all git repositories and place them in directories according to their remote paths
    • find - find all git repositories in a given directory - useful for tools like skim
    • clone - initialize a local copy of a remote repository
  • the gixp program (plumbing) - lower level commands for use in automation
    • pack
      • pack verify
      • pack index verify including each object sha1 and statistics
      • pack explode, useful for transforming packs into loose objects for inspection or restoration
        • verify written objects (by reading them back from disk)
      • pack-receive - receive a whole pack produced by pack-send or git-upload-pack, useful for clone like operations.
      • pack-send - create a pack and send it using the pack protocol to stdout, similar to 'git-upload-pack', for consumption by pack-receive or git-receive-pack
    • pack-index
      • index from data - create an index file by streaming a pack file as done during clone
        • support for thin packs (as needed for fetch/pull)
    • commit-graph
      • verify - assure that a commit-graph is consistent
    • remote-ref-list
      • list all (or given) references from a remote at the given URL


Follow linked crate name for detailed status.

Stress Testing

  • Verify huge packs
  • Explode a pack to disk
  • Generate and verify large commit graphs
  • Generate huge pack from a lot of loose objects

Ideas for Demos

  • A simple git-hours clone
  • Open up SQL for git using sqlite virtual tables. Check out gitqlite as well. What would an MVP look like? Maybe even something that could ship with gitoxide.


Binary Release

curl -LSfs | \
    sh -s -- --git Byron/gitoxide --crate gix-max-termion

See the releases section for manual installation and various alternative builds that are slimmer or smaller, depending on your needs, for Linux, MacOS and Windows.


cargo is the Rust package manager which can easily be obtained through rustup. With it, you can build your own binary effortlessly and for your particular CPU for additional performance gains.

# The default installation, 'max'
cargo install gitoxide

# On linux, it's a little faster to compile the termion version, which also results in slightly smaller binaries
cargo install gitoxide --no-default-features --features max-termion

# For smaller binaries and even faster build times that are traded for a less fancy CLI implementation, use `lean`
# or `lean-termion` respectively.
cargo install gitoxide --no-default-features --features lean


Once installed, there are two binaries:

  • gix
    • high level commands, porcelain, for every-day use, optimized for a pleasant user experience
  • gixp
    • low level commands, plumbing, for use in more specialized cases

Project Goals

Project goals can change over time as we learn more, and they can be challenged.

  • a pure-rust implementation of git
    • including transport, object database, references, cli and tui
    • a simple command-line interface is provided for the most common git operations, optimized for user experience. A simple-git if you so will.
    • be the go-to implementation for anyone who wants to solve problems around git, and become the alternative to GitPython in the process.
    • become the foundation for a free distributed alternative to GitHub, and maybe even GitHub itself
  • learn from the best to write the best possible idiomatic Rust
    • libgit2 is a fantastic resource to see what abstractions work, we will use them
    • use Rust's type system to make misuse impossible
  • be the best performing implementation
    • use Rust's type system to optimize for work not done without being hard to use
    • make use of parallelism from the get go
  • assure on-disk consistency
    • assure reads never interfere with concurrent writes
    • assure multiple concurrent writes don't cause trouble
  • take shortcuts, but not in quality
    • binaries may use anyhow::Error exhaustively, knowing these errors are solely user-facing.
    • libraries use light-weight custom errors implemented using quick-error or thiserror.
    • internationalization is nothing we are concerned with right now.
    • IO errors due to insufficient amount of open file handles don't always lead to operation failure
  • Cross platform support, including Windows
    • With the tools and experience available here there is no reason not to support Windows.
    • Windows is testsed on CI and failures do prevent releases.


Project non-goals can change over time as we learn more, and they can be challenged.

  • replicate git command functionality perfectly
    • git is git, and there is no reason to not use it. Our path is the one of simplicity to make getting started with git easy.
  • be incompatible to git
    • the on-disk format must remain compatible, and we will never contend with it.
  • use async IO everywhere
    • for the most part, git operations are heavily relying on memory mapped IO as well as CPU to decompress data, which doesn't lend itself well to async IO out of the box.
    • Use blocking as well as git-features::interrupt to bring operations into the async world and to control long running operations.
    • When connecting or streaming over TCP connections, especially when receiving on the server, async seems like a must though, but behind a feature flag.


If what you have seen so far sparked your interest to contribute, then let us say: We are happy to have you and help you to get started.

A backlog for work ready to be picked up is available in the Project's Kanban board, which contains instructions on how to pick a task. If it's empty or you have other questions, feel free to start a discussion or reach out to @Byron privately.

Roadmap to Future

Roadmap to 1.0

Provide a CLI to for the most basic user journey:

  • initialize a repository
  • clone a repository
  • create a commit
  • add a remote
  • push
    • create (thin) pack

Cargo features guide

Cargo uses feature toggles to control which dependencies are pulled in, allowing users to specialize crates to fit their usage. Ideally, these should be additive. This guide documents which features are available for each of the crates provided here and how they function.


The top-level command-line interface.

  • fast
    • Makes the crate execute as fast as possible by supporting parallel computation of otherwise long-running functions as well as fast, hardware accelerated hashing.
    • If disabled, the binary will be visibly smaller.
  • http
    • support synchronous 'http' and 'https' transports (e.g. for clone, fetch and push) at the expense of compile times and binary size
  • (mutually exclusive)
    • pretty-cli
      • Use clap 3.0 to build the prettiest, best documented and most user-friendly CLI at the expense of binary size.
      • provides a terminal user interface for detailed and exhaustive progress.
      • provides a line renderer for leaner progress
    • lean-cli
      • Use argh to produce a usable binary with decent documentation that is smallest in size, usually 300kb less than pretty-cli.
      • If pretty-cli is enabled as well, lean-cli will take precedence, and you pay for building unnecessary dependencies.
      • provides a line renderer for lean but pretty progress
  • prodash-render-line-crossterm or prodash-render-line-termion (mutually exclusive)
    • The --verbose flag will be powered by an interactive progress mechanism that doubles as log as well as interactive progress that appears after a short duration.
  • gitoxide-core-organize
    • An alias for gitoxide-core/organize.

There are convenience features, which combine common choices of the above into one name

  • max = pretty-cli + fast + prodash-render-tui-crossterm + http + gitoxide-core-organize
    • default, for unix and windows
  • max-termion = pretty-cli + fast + prodash-render-tui-termion + http + gitoxide-core-organize
    • for unix only, faster compile times, a little smaller
  • lean = lean-cli + fast + prodash-render-line-crossterm + gitoxide-core-organize
    • for unix and windows, significantly smaller than max, but without --progress terminal user interface.
  • lean-termion = lean-cli + fast + prodash-render-line-termion + gitoxide-core-organize
    • for unix only, faster compile times, a little smaller
  • light = lean-cli + fast + gitoxide-core-organize
    • crossplatform by nature as this comes with simplified log based progress
  • small = lean-cli
    • As small as it can possibly be, no threading, no fast sha1, log based progress only, no cleanup of temporary files on interrupt


The library powering the command-line interface.

  • organize
    • provides the 'organize' subcommand
      • Includes jwalk to find repositories quickly in order to move into a directory structure automatically.
    • provides the 'find' subcommand
      • discover all git repositories within a directory. Particularly useful with skim.


  • polonius
    • If set, a code path will be provided which as of 2021-04-04 only works when using polonius.
      • Activate using mkdir -p .cargo && echo $'[build]\nrustflags = "-C target-cpu=native -Zpolonius"' > .cargo/config.toml.


A crate to help controlling which capabilities are available from the top-level crate that uses gitoxide-core or any other gitoxide crate that uses git-features. All feature toggles are additive.

  • parallel
    • Use scoped threads and channels to parallelize common workloads on multiple objects. If enabled, it is used everywhere where it makes sense.
    • As caches are likely to be used and instantiated per thread, more memory will be used on top of the costs for threads.
  • fast-sha1
    • a multi-crate implementation that can use hardware acceleration, thus bearing the potential for up to 2Gb/s throughput on CPUs that support it, like AMD Ryzen or Intel Core i3.
  • mutually-exclusive
    • interrupt-handler
      • Listen to interrupts and termination requests and provide long-running operations tooling to allow aborting the input stream.
        • Note that git_features::interrupt::init_handler() must be called at the start of the application.
      • If the application already sets a handler, this handler will have no effect.
      • If unset, these utilities can still be triggered programmatically. However, interrupting with Ctrl+C or SIGTERM may lead to leaking temporary files.
    • disable-interrupts (takes precedence if interrupt-handler is set as well)
      • If set, interrupts cannot be triggered programmatically and it's up to the user to inject means of supporting interrupts.
      • Useful if there is multiple interruptible operations at the same time that should be triggered independently. After all, this facility is a global one.
      • Probably useful for server implementations.
  • io-pipe
    • an in-memory unidirectional pipe using bytes as efficient transfer mechanism


  • http-client-curl
    • Adds support for the http and https transports using the Rust bindings for libcurl

Serialization Support

What follows is feature toggles to control serialization of all public facing simple data types.

  • serde1
    • Data structures implement serde::Serialize and serde::Deserialize

The feature above is provided by the crates:

  • git-object
  • git-url
  • git-odb
  • git-protocol
  • gitoxide-core

Plumbing vs Porcelain

Both terms are coming from the git implementation itself, even though it won't necessarily point out which commands are plumbing and which are porcelain. The term plumbing refers to lower-level, more rarely used commands that complement porcelain by being invoked by it or by hand for certain use cases. The term porcelain refers to those with a decent user experience, they are primarily intended for use by humans.

In any case, both types of programs must self-document their capabilities using through the --help flag.

From there, we can derive a few rules to adhere to unless there are good reasons not to:


  • does not show any progress or logging output by default
  • if supported and logging is enabled, it will show timestamps in UTC
  • it does not need a git repository, but instead takes all required information via the command-line


  • Provides output to stderr by default to provide progress information. There is no need to allow disabling it, but it shouldn't show up unless the operation takes some time.
  • If timestamps are shown, they are in localtime.
  • Non-progress information goes to stdout.


  • fetches using protocol V1 and stateful connections, i.e. ssh, git, file, may hang
    • This can be fixed by making response parsing.
    • Note that this does not affect cloning, which works fine.
  • lean and light and small builds don't support non-UTF-8 paths in the CLI
    • This is because they depend on argh, which does not yet support parsing OsStrings. We however believe it eventually will do so and thus don't move on to pico-args.
    • Only one level of sub-commands are supported due to a limitation of argh, which forces porcelain to limit itself as well despite using clap. We deem this acceptable for plumbing commands and think that porcelain will be high-level and smart enough to not ever require deeply nested sub-commands.
  • Packfiles use memory maps
    • Even though they are comfortable to use and fast, they squelch IO errors.
    • potential remedy: We could generalize the Pack to make it possible to work on in-memory buffers directly. That way, one would initialize a Pack by reading the whole file into memory, thus not squelching IO errors at the expense of latency as well as memory efficiency.
  • Packfiles cannot load files bigger than 2^31 or 2^32 on 32 bit systems
    • As these systems cannot address more memory than that.
    • potential remedy: implement a sliding window to map and unmap portions of the file as needed.
      • However, those who need to access big packs on these systems would rather resort to git itself, allowing our implementation to be simpler and potentially more performant.
  • Objects larger than 32 bits cannot be loaded on 32 bit systems
    • in-memory representations objects cannot handle objects greater than the amount of addressable memory.
    • This should not affect git LFS though.
  • CRC32 implementation doesn't use SIMD
    • Probably at no cost one could upgrade to the crc32fast crate, but it looks unmaintained and builds more slowly.
  • git-url might be more restrictive than what git allows as for the most part, it uses a browser grade URL parser.
    • Thus far there is no proof for this, and as potential remedy we could certainly re-implement exactly what git does to handle its URLs.


  • itertools (MIT Licensed)
    • We use the izip! macro in code
  • deflate2 (MIT Licensed)
    • We use various abstractions to implement decompression and compression directly on top of the rather low-level miniz_oxide crate


This project is licensed under either of

at your option.

Fun facts

  • Originally @Byron was really fascinated by this problem and believes that with gitoxide it will be possible to provide the fastest solution for it.
  • @Byron has been absolutely blown away by git from the first time he experienced git more than 13 years ago, and tried to implement it in various shapes and forms multiple times. Now with Rust @Byron finally feels to have found the right tool for the job!