Skip to main content

A Git-like version control system implemented in Python

Project description

๐Ÿš€ RVS - Git-like Version Control System

Python Version Version License

RVS is a powerful, Git-like version control system implemented entirely in Python. It provides familiar Git commands and workflows without requiring Git installation, making it perfect for educational purposes, embedded systems, or environments where Git isn't available.

โœจ Features

  • ๐Ÿ”ง Complete Git-like Interface - Familiar commands and workflows
  • ๐Ÿ Pure Python Implementation - No external dependencies required
  • ๐Ÿ“ฆ Easy Installation - Install via pip or run directly
  • ๐ŸŒณ Full Branching Support - Create, switch, and merge branches
  • ๐Ÿ“ Staging Area - Add and commit changes with precision
  • ๐Ÿ“š Commit History - View and navigate project history
  • ๐Ÿ”„ Advanced Operations - Rebase, stash, worktree management
  • ๐Ÿ› ๏ธ Extensible Architecture - Clean, modular codebase

๐Ÿš€ Quick Start

Installation

# Clone the repository
git clone https://github.com/rvs-rvs/rvs.git
cd rvs

# Install using pip
pip install .

# Or install in development mode
pip install -e .

Basic Usage

# Initialize a new repository
rvs init

# Add files to staging area
rvs add file.txt
rvs add .

# Create a commit
rvs commit -m "Initial commit"

# Check repository status
rvs status

# View commit history
rvs log

๐Ÿ“‹ Available Commands

RVS supports all essential Git operations:

Command Description Example
init Initialize a new repository rvs init
add Add files to staging area rvs add file.txt
commit Create a commit rvs commit -m "message"
status Show repository status rvs status
log Show commit history rvs log
branch List or create branches rvs branch feature
checkout Switch branches or restore files rvs checkout main
merge Join development histories rvs merge feature
rebase Reapply commits on another base rvs rebase main
restore Restore working tree files rvs restore file.txt
rm Remove files from index/working tree rvs rm file.txt
ls-files Show files in index and working tree rvs ls-files
ls-tree List contents of tree objects rvs ls-tree HEAD
worktree Manage multiple working trees rvs worktree add ../feature
stash Stash changes temporarily rvs stash

๐Ÿ’ก Usage Examples

Basic Workflow

# Start a new project
mkdir my-project && cd my-project
rvs init

# Add some files
echo "Hello World" > hello.txt
rvs add hello.txt
rvs commit -m "Add hello.txt"

# Create and switch to a new branch
rvs branch feature
rvs checkout feature

# Make changes and commit
echo "Feature code" > feature.txt
rvs add feature.txt
rvs commit -m "Add feature"

# Switch back and merge
rvs checkout main
rvs merge feature

Advanced Operations

# Stash uncommitted changes
rvs stash

# Work with multiple worktrees
rvs worktree add ../hotfix hotfix-branch

# Interactive rebase (reapply commits)
rvs rebase main

# Restore specific files from a commit
rvs restore --source=HEAD~1 file.txt

Repository Management

# Check what's staged and unstaged
rvs status

# View detailed commit history
rvs log --oneline

# List all files tracked by RVS
rvs ls-files

# Examine tree structure
rvs ls-tree HEAD

๐Ÿ—๏ธ Architecture

RVS is built with a clean, modular architecture:

rvs/
โ”œโ”€โ”€ core/           # Core functionality
โ”‚   โ”œโ”€โ”€ repository.py   # Repository management
โ”‚   โ”œโ”€โ”€ objects.py      # Git object handling
โ”‚   โ”œโ”€โ”€ index.py        # Staging area
โ”‚   โ”œโ”€โ”€ refs.py         # Branch/tag references
โ”‚   โ””โ”€โ”€ hooks.py        # Hook system
โ”œโ”€โ”€ commands/       # Command implementations
โ”‚   โ”œโ”€โ”€ add.py          # Add command
โ”‚   โ”œโ”€โ”€ commit.py       # Commit command
โ”‚   โ”œโ”€โ”€ branch.py       # Branch operations
โ”‚   โ””โ”€โ”€ ...             # Other commands
โ”œโ”€โ”€ cli.py          # Command-line interface
โ””โ”€โ”€ exceptions.py   # Custom exceptions

๐Ÿ”ง Command Line Options

usage: rvs [-h] [--repo REPO] [--version] {command} ...

RVS - Git-like Version Control System

positional arguments:
  {init,add,commit,status,log,branch,checkout,merge,rebase,restore,rm,ls-files,ls-tree,worktree,stash}
                        Available commands

options:
  -h, --help            Show help message and exit
  --repo REPO           Repository path (default: current directory)
  --version             Show program's version number and exit

๐Ÿค Contributing

We welcome contributions! Here's how you can help:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Make your changes and add tests
  4. Commit your changes (git commit -m 'Add amazing feature')
  5. Push to the branch (git push origin feature/amazing-feature)
  6. Open a Pull Request

Development Setup

# Clone the repository
git clone https://github.com/rvs-rvs/rvs.git
cd rvs

# Install in development mode
pip install -e .

# Run tests (if available)
python -m pytest

# Run RVS directly
python -m rvs --help

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ™ Acknowledgments

  • Inspired by Git's elegant design and powerful functionality
  • Built with Python's excellent standard library
  • Thanks to the open-source community for inspiration and feedback

๐Ÿ“ž Contact


โญ Star this repository if you find it useful! โญ

Made with โค๏ธ by the RVS Team

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

rvs-1.1.0.tar.gz (38.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rvs-1.1.0-py3-none-any.whl (49.3 kB view details)

Uploaded Python 3

File details

Details for the file rvs-1.1.0.tar.gz.

File metadata

  • Download URL: rvs-1.1.0.tar.gz
  • Upload date:
  • Size: 38.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for rvs-1.1.0.tar.gz
Algorithm Hash digest
SHA256 9f567e0a06bb56396532676c8d2364a750766c280899370e8f5ed1fff8804bb4
MD5 b20b3a2e844e8c6861447d494a9d5cae
BLAKE2b-256 3bae1e40637e3567528b34c661f70f4cfb1a7a9725d4f0f75610da93ec77d7b2

See more details on using hashes here.

File details

Details for the file rvs-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: rvs-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 49.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for rvs-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 50225333fe9fe42c0659d032c9511c85af269fd920aa9855c32b207eea74783f
MD5 0af23fc9cfb06d1767e03dd4371c3fba
BLAKE2b-256 6427ec44c2eaebe0ad42b0901a1f02a876dff55a540598d96fde792c091d8dfd

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