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...

Keyboard Shortcuts

Navigation
Next / previous item
j/k
Open post
oorEnter
Preview post
v
Post Actions
Love post
a
Like post
l
Dislike post
d
Undo reaction
u
Recommendations
Add interest / feed
Enter
Not interested
x
Go to
Home
gh
Interests
gi
Feeds
gf
Likes
gl
History
gy
Changelog
gc
Settings
gs
Browse
gb
Search
/
General
Show this help
?
Submit feedback
!
Close modal / unfocus
Esc

Press ? anytime to show this help