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.
$ 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
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.
- Windows
- Linux
- MacOS
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
).
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.
-
init
-
add
-
rm
-
status
-
commit
-
log
-
tag
-
switch
-
restore
-
reset
-
branch
-
diff
-
merge
-
rebase
-
index-pack
-
remote
-
lfs
-
config
-
push
-
pull
-
clone
-
fetch
-
.gitignore
-
.gitattributes
(only forlfs
now) -
LFS
(embedded) -
ssh
Refs to Development