I implemented init, add, commit, branch, checkout, and merge in Go!
github.com·3h·
Discuss: r/golang
Flag this post

Mini-Git

A simple Git clone built in Go. I’m building this to understand how version control systems work under the hood.

Installation

Get it installed with:

go install github.com/hanzala211/mini-git@latest

The mini-git Command

Everything starts with the mini-git command. It’s built using Cobra, so it follows a similar structure to Git with subcommands. Right now I have init, add, commit, branch, checkout, and merge.

What I’ve Built So Far

Repository Management

When you run mini-git init, it sets up a .minigit folder in your project. Inside, I create:

  • An objects directory where I store all your files (compressed and hashed)
  • An index.json file that acts as my staging area
  • Basic branch references with a HEAD file poin…

Similar Posts

Loading similar posts...