Skip to content

Latest commit

 

History

History
88 lines (77 loc) · 2.63 KB

README.md

File metadata and controls

88 lines (77 loc) · 2.63 KB

Libra

Libra is a partial implementation of a Git client, developed using Rust. Our goal is not to create a 100% replica of Git (for those interested in such a project, please refer to the gitoxide). Instead, libra focus on implementing the basic functionalities of Git for learning Git and Rust. A key feature of libra is the replacement of the original Git internal storage architecture with SQLite.

Example

$ libra --help
Simulates git commands

Usage: libra <COMMAND>

Commands:
  init     Initialize a new repository
  clone    Clone a repository into a new directory
  add      Add file contents to the index
  rm       Remove files from the working tree and from the index
  restore  Restore working tree files
  status   Show the working tree status
  log      Show commit logs
  branch   List, create, or delete branches
  commit   Record changes to the repository
  switch   Switch branches
  merge    Merge changes
  push     Update remote refs along with associated objects
  fetch    Download objects and refs from another repository
  pull     Fetch from and integrate with another repository or a local branch
  remote   Manage set of tracked repositories
  help     Print this message or the help of the given subcommand(s)

Options:
  -h, --help     Print help
  -V, --version  Print version

Features

Clean Code

Our code is designed to be clean and easy to read, ensuring that it is both maintainable and understandable for developers of all skill levels.

Cross-Platform

  • Windows
  • Linux
  • MacOS

Compatibility with Git

Our implementation is essentially fully compatible with Git (developed with reference to the Git documentation), including formats such as objects, index, pack, and pack-index. Therefore, it can interact seamlessly with Git servers (like push and pull).

Differences from Git:

While maintaining compatibility with Git, we have made some innovations and changes: we use an SQLite database to manage loosely structured files such as config, HEAD, and refs, achieving unified management.

Functions

Commands

  • init
  • add
  • rm
  • status
  • commit
  • log
  • tag
  • switch
  • restore
  • reset
  • branch
  • diff
  • merge
  • rebase
  • index-pack
  • remote
  • lfs
  • config

Remote

  • push
  • pull
  • clone
  • fetch

Others

  • .gitignore
  • .gitattributes (only for lfs now)
  • LFS (embedded)
  • ssh

Development

Refs to Development