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.

🎥 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.3.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.3-py3-none-any.whl (6.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: gitmini-0.1.3.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.3.tar.gz
Algorithm Hash digest
SHA256 17ee5f49f8716467c236691236913017dc2c2d486838158d3475aa3e8d019ac7
MD5 49474d0e31f1de1dc444fb0718aa7290
BLAKE2b-256 7b50ddc2aba441d870060bc855fece49a1aec3bc0d24704aa1e31aa9039683ca

See more details on using hashes here.

File details

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

File metadata

  • Download URL: gitmini-0.1.3-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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 b486ff278db722a809fbbe049b9c6582bec3da9128a812d7c57be017f1e4caae
MD5 451daad71df9a7c49402a0cb554e26a3
BLAKE2b-256 a7763830404400d206c011d0e73e2cc9cededa68c116992411871e58eadc8d8e

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