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)

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

(gif to be added here)

🌿 Branching Workflow (log, branch, checkout)

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

(gif to be added here)


🛠️ 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.2.tar.gz (15.1 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.2-py3-none-any.whl (17.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: gitmini-0.1.2.tar.gz
  • Upload date:
  • Size: 15.1 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.2.tar.gz
Algorithm Hash digest
SHA256 b3f656d097944d16a897b7d0379397923d82d112b2c0ec5f8027910ef85d65df
MD5 8964332917f9504113adb33c382c8409
BLAKE2b-256 bd846cbe8c9312b1548d77a6b9b4722e0ae1c2e38e085d294e07d85f6a26aeea

See more details on using hashes here.

File details

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

File metadata

  • Download URL: gitmini-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 17.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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 cffd1767eafd070650cf3fd464ffbc50f8c4caa5423bbc809bb5bef1e325254e
MD5 1e1366544ec468fd32ea4ff97bf8cd9f
BLAKE2b-256 c5492aa47c21df96ef208c25f557f2fe0d651c985d4808dd7a2e288f88c97737

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