Gix is a minimal version control system built with Node.js. It lets you:
- init a repo
- add files
- commit changes
- view log
- show diffs between commits
Perfect for learning how Git works under the hood.
-
Install dependencies:
npm install
-
Make the script executable:
chmod +x gix.mjs
-
Run it using:
node gix.mjs <command>
-
gix init
Initialize a repo. -
gix add <file>
Stage a file. -
gix commit "message"
Commit staged files. -
gix log
Show commit history. -
gix show <commit-hash>
Show commit diff.
gix init
gix add notes.txt
gix commit "Add notes"
gix log
gix show abc123To understand how Git-like systems work: hashing, staging, committing, and diffing — all in plain JavaScript.
Contributions are welcome! Feel free to open issues or submit pull requests.