Skip to main content

A lightweight CLI version control system that replicates core Git commands from scratch.

Project description

GitMini

PyPI License

GitMini is a lightweight Version Control System built from scratch in Python. It replicates core non-remote Git commands like init, add, commit, log, checkout, and branch.

⭐ This project has been uploaded to PyPI! Find the link here: https://pypi.org/project/gitmini/


💪 Motivation

  • Exercise in-depth DSA and OOP practices.
  • Demystify Git and learn safe Version Control principles.
  • Deploy a real-world package to PyPI adhering to PEP standards.
  • Practice safe SDLC methods and continuously test during development.
  • Build a CLI tool from scratch.
  • Learn to efficiently store and search data with hashing.

🎥 Demo

🧱 Core Workflow (init, add, commit, .gitmini-ignore)

Core Workflow

  • Initializing a repository
  • Staging (adding) changes
  • Comitting files
  • .gitmini-ignore support



🌿 Branching Workflow (log, branch, checkout)

Branching Workflow

  • Checking commit logs
  • Viewing current branch, creating new branch
  • Checkout to branches and past commits

🛠️ Features

  • gitmini init – Initialize a new GitMini repository
  • gitmini add – Stage changes (individual files, folders, or .)
  • gitmini commit – Commit staged changes
  • gitmini log – View commit history
  • gitmini checkout – Switch between branches or restore old versions
  • Simple .gitmini-ignore support
  • Content-addressable storage using SHA-1
  • No external dependencies

📦 Installation and Usage

Make sure to create and activate a Python virtual environment before anything.

GitMini is meant to be run inside an activated virtual environment -- it doesn’t add itself to PATH globally.

  1. Navigate into your desired directory, then create & activate your virtual environment
cd project-root
python -m venv .venv
.\.venv\Scripts\activate
  1. Install 'gitmini' via pip
pip install gitmini
  1. Initialize a GitMini repository.
gitmini init

This command will generate the repository (.gitmini/), and the .gitmini-ignore file

  1. Ensure that your virtual environment file is ignored by adding it to the .gitmini-ignore file.

If you do not do this, GitMini will track your venv, and the program could break.

# Within .gitmini-ignore, type the following:
<your-virtual-environment>/
  1. Create project files/folders as you please, then stage your changes.

Any of the following commands can be used:

# To add a specific file or folder:
gitmini add <file> <folder>

# To add all files in the repo: 
gitmini add .
  1. Make your first commit!
gitmini commit -m "Initial commit"

And you're done! You can now freely use GitMini to track your files.

And just like Git, you can make a new branch, checkout to them, and view the commit log.

👤 Author

James David Furtado

jamesdfurtado@gmail.com

https://www.linkedin.com/in/james-furtado/

📄 License

MIT License. See LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gitmini-0.1.5.tar.gz (19.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gitmini-0.1.5-py3-none-any.whl (27.7 kB view details)

Uploaded Python 3

File details

Details for the file gitmini-0.1.5.tar.gz.

File metadata

  • Download URL: gitmini-0.1.5.tar.gz
  • Upload date:
  • Size: 19.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for gitmini-0.1.5.tar.gz
Algorithm Hash digest
SHA256 6ff5e698f4af24d56fb6217a14f5f1da8444a9c454c69a7d590ecb164c96f4b3
MD5 8c69822c399a02334375ada0dc0c8c82
BLAKE2b-256 a31ef3cb0b9308c0847846bc4a463f9ab34c6f26d0a152fc051d4ec046c150f8

See more details on using hashes here.

File details

Details for the file gitmini-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: gitmini-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 27.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for gitmini-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 0449e9980d9be355ad1a96f7c34f359f8b56dd0bcb2fc04a11ccb18ba0de1926
MD5 06dd05039e74f81a5aa49331c6c5ed59
BLAKE2b-256 0f71d40c3f0d511f3318184d039d7dcfca0d0960e7f2629a2fa7b144c8ce893f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page