This repository guides you through the implementation of basic Git functionalities, including initializing a local repository, adding file(s) to the staging area, committing changes with messages, checking the status of your working directory, and viewing the log/commit history. It also covers essential underlying mechanisms like content hashing and compression.
This repository contains two branches:
exercise: This is the branch you should work in. It contains the initial file structure and prompts to guide your implementation.solution: This branch provides a complete, functional example of the Git basics implemented in this repository. You can refer to this branch if you get stuck or want to see how the code should work.
This implementation relies solely on Python's standard library, eliminating the need for a virtual environment.
To experiment with this tool, ensure you have some .txt or .py files readily available for tracking and committing.
Each file contains prompts to guide you through completing the implementation of basic Git functionalities. You'll progress through different features, starting with simpler approaches in v1 and more advanced ones in v2. I recommend completing v1 before starting on v2.
- basic_git_1.py
- basic_git_2.py
Git
hashlib
- https://www.geeksforgeeks.org/hashlib-module-in-python/
- https://docs.python.org/3/library/hashlib.html
zlib