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.4.tar.gz (6.2 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.4-py3-none-any.whl (6.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: gitmini-0.1.4.tar.gz
  • Upload date:
  • Size: 6.2 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.4.tar.gz
Algorithm Hash digest
SHA256 9decee2a45d35718e12d3a9b38d6ff2f4c0a490d527e0962da33062d9a796f08
MD5 ecdbdd5a50960c053c9acc30c9b47af1
BLAKE2b-256 1b75fba66beb20f305a2b8375fbce8558a035cf131723a8864f26828d134e9df

See more details on using hashes here.

File details

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

File metadata

  • Download URL: gitmini-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 6.2 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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 e54a353118de6ff2aadbc48d8543258a91005a9f7c30431abb2221d6694eb456
MD5 ac1b747654b102e01173898f40a51e88
BLAKE2b-256 456938b1eb1b81683c763177e07de8c31ef55281f5a52546a7d57d9a077d1525

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