Welcome to wyag! This project is an educational journey to understand the internals of Git by rewriting it in Python. This repository follows the guide "Write Yourself a Git" by Thibault Polge.
wyag is an attempt to demystify the inner workings of Git by implementing its core functionalities in Python. This project is inspired by the "Write Yourself a Git" guide and aims to provide a hands-on learning experience for those interested in understanding how version control systems work under the hood.
- Initialization: Create a new repository.
- Committing: Record changes to the repository.
- Branching: Create, list, and switch branches.
- Merging: Combine different branches.
- Logging: View commit history.
- Diffing: Show changes between commits.
To get started with wyag, you'll need Python 3.6 or higher. You can clone this repository and install the necessary dependencies:
git clone https://github.com/yourusername/wyag.git
cd wyag
pip install -r requirements.txtOnce installed, you can start using wyag from the command line. Here are some basic commands:
# Initialize a new repository
python wyag.py init
# Add a file to the staging area
python wyag.py add <file>
# Commit changes
python wyag.py commit -m "Your commit message"
# Create a new branch
python wyag.py branch <branch_name>
# Switch to a branch
python wyag.py checkout <branch_name>
# Merge a branch into the current branch
python wyag.py merge <branch_name>
# View commit history
python wyag.py log
# Show changes between commits
python wyag.py diff <commit1> <commit2>For a full list of commands and options, refer to the documentation or use the --help flag:
python wyag.py --helpHere's an overview of the project structure:
wyag/
├── libwyag.py # Core functionality of the 'wyag' package
├── wyag.py # Main executable script
├── setup.py # Defines the installation details
└── README.md # This README file
Contributions are welcome! If you have any ideas, suggestions, or bug reports, please open an issue or submit a pull request. Make sure to follow the code style and include tests for new features.
- Fork the repository
- Create a new branch (
git checkout -b feature-branch) - Make your changes
- Commit your changes (
git commit -am 'Add new feature') - Push to the branch (
git push origin feature-branch) - Create a new Pull Request
This project is licensed under the MIT License. See the LICENSE file for details.
- Gabriele Cinà For inspiring us with his live to follow this project with him.
- Thibault Polge for the "Write Yourself a Git" guide.
- The Git Community for their incredible work on Git.