Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lpreaux/codecrafter-git-rust
Rust implementation of Git as part of the "Build Your Own Git" challenge on CodeCrafters.io. This project demonstrates key Git concepts such as blob and tree objects, commits, and repository cloning. Currently, 6/7 stages are completed.
https://github.com/lpreaux/codecrafter-git-rust
challenge codecrafters git git-internals rust version-control
Last synced: 18 days ago
JSON representation
Rust implementation of Git as part of the "Build Your Own Git" challenge on CodeCrafters.io. This project demonstrates key Git concepts such as blob and tree objects, commits, and repository cloning. Currently, 6/7 stages are completed.
- Host: GitHub
- URL: https://github.com/lpreaux/codecrafter-git-rust
- Owner: lpreaux
- Created: 2024-10-24T21:28:45.000Z (22 days ago)
- Default Branch: master
- Last Pushed: 2024-10-24T21:42:34.000Z (22 days ago)
- Last Synced: 2024-10-26T09:27:48.508Z (21 days ago)
- Topics: challenge, codecrafters, git, git-internals, rust, version-control
- Language: Rust
- Homepage:
- Size: 39.1 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Build Your Own Git - Rust Implementation
![progress-banner](https://backend.codecrafters.io/progress/git/c9ea89fa-af0b-4af3-907c-2a7262b1b763)
Welcome to my **Rust-based implementation** of Git, built as part of the ["Build Your Own Git" Challenge](https://codecrafters.io/challenges/git) on CodeCrafters.io.
## π Challenge Overview
This project is an opportunity to explore the inner workings of Git, one of the most widely used version control systems in software development. Throughout this challenge, Iβve implemented a simplified version of Git from scratch using **Rust**, focusing on core functionalities such as:
- Initializing a Git repository (`.git` directory)
- Handling **blob** objects (create and read)
- Handling **tree** objects (create and read)
- Creating **commits**
- Cloning a public GitHub repositoryBy the end of the challenge, my Git implementation will be capable of performing many fundamental Git operations. This has been an excellent learning experience in both **Rust programming** and **Git internals**.
## π Current Progress
I have successfully completed **6 out of 7 stages** in the challenge. Below are the key stages:
1. **Initialize the .git directory** - β
2. **Read a blob object** - β
3. **Create a blob object** - β
4. **Read a tree object** - β
5. **Write a tree object** - β
6. **Create a commit** - β
7. **Clone a repository** - In ProgressEach step has deepened my understanding of the way Git operates under the hood, especially how it manages and stores different objects (blobs, trees, commits) and the challenges related to handling them efficiently in Rust.
## π§βπ» How to Run
You can experiment with this project locally. The entry point is located in `src/bin/git.rs`. Here's how you can get started:
1. Ensure you have **cargo (>=1.80)** installed.
2. Build and run the project with the following commands:```sh
cargo build
cargo run -- init
```3. You can also use the option `-h` or `--help` to get more detailed documentation and usage information:
```sh
cargo run -- -h
```4. To avoid any accidental changes to your Git repository during local testing, itβs recommended to test the program in a separate directory:
```sh
mkdir -p /tmp/testing && cd /tmp/testing
cargo run -- init
```## π§ͺ Testing
For safety, execute the program in a different folder to prevent modifying the `.git` folder of this project:
```sh
mkdir -p /tmp/testing && cd /tmp/testing
cargo run -- init
```## π― Future Improvements
- Completing the final step: **Cloning a repository**
- Adding more test cases to ensure the robustness of the implementation
- Improving the error handling and performance of the Rust code## π§ Technologies Used
- **Rust**: The core programming language used to build the project
- **Git**: The system being implemented
- **CodeCrafters.io**: The platform providing the challengeFeel free to explore, or reach out for any questions!