IRSHIT033/Zypher

A lightweight version control system inspired by Git, implemented in Go.

★ 0Forks 0GoGitHub ↗Compare

README

Zypher

A lightweight version control system inspired by Git, implemented in Go.

███████╗██╗   ██╗██████╗ ██╗  ██╗███████╗██████╗
╚══███╔╝╚██╗ ██╔╝██╔══██╗██║  ██║██╔════╝██╔══██╗
  ███╔╝  ╚████╔╝ ██████╔╝███████║█████╗  ██████╔╝
 ███╔╝    ╚██╔╝  ██╔═══╝ ██╔══██║██╔══╝  ██╔══██╗
███████╗   ██║   ██║     ██║  ██║███████╗██║  ██║
╚══════╝   ╚═╝   ╚═╝     ╚═╝  ╚═╝╚══════╝╚═╝  ╚═╝

Features

  • Initialize repositories
  • Track file changes
  • Create and manage commits
  • Branch management
  • Commit history viewing
  • File status checking
  • Commit reverting

Installation

go install github.com/IRSHIT033/zypher

Usage

Initialize a Repository

zypher init

Check Repository Status

zypher status

Create a Commit

zypher commit "Your commit message"

View Commit History

zypher log

Revert to a Previous Commit

zypher revert <commit-hash>

Branch Management

List all branches:

zypher branch

Create a new branch:

zypher branch <branch-name>

Switch to a branch:

zypher checkout <branch-name>

Repository Structure

Zypher stores its data in a .zypher directory with the following structure:

.zypher/
├── objects/          # Stores file contents and commits
│   └── <hash-prefix>/
│       └── <hash-suffix>
├── refs/
│   └── heads/        # Branch references
│       ├── main      # Default branch
│       └── <branch>  # Other branches
└── HEAD             # Points to current branch

How It Works

  • Objects: Files and commits are stored as blobs in the objects directory
  • References: Branches are stored in the refs/heads directory
  • HEAD: Points to the current branch
  • Commits: Store file hashes and metadata
  • Branches: Point to specific commits

License

MIT

Issues