Implementing git structures and functions in pure zig.
Still very much a work in progress. Some commands are redundant and some will get replaced.
This project is primarily for learning purposes and not meant to be a replacement for something like libgit2.
It doesn't support pack deltas yet.
The zig-git
command currently supports the following subcommands:
add <target>
- Add a file or directory to the git indexbranch
- List current branches (refs/heads/
) in a format similar togit branch
branch-create <name>
- Create a new branch from the current branchcheckout
- Checkout a ref or commitcommit
- Commit the current index (as a test, doesn't use correct information)index
- List out the content of the indexinit [directory]
- Create a new git repositorylog
- List commitsread-commit <hash>
- Parse and display a commitread-object <hash>
- Dump the decompressed contents of an object to stdoutread-pack <id>
- Parse a pack file and iterate over its contentsread-pack-index <id> <hash>
- Search a pack file index for the offset of an object with a hash in a pack fileread-ref [ref]
- Display a ref and what it points to, or all refs if no argument is givenread-tag [ref]
- Parse and display a tagread-tree <name>
- Parse and display the all files in a treerefs
- List all refsrm <file>
- Remove file from indexroot
- Print the root of the current git projectstatus
- Branch status