A simple Git implementation written in Go. This project implements core Git functionality including repository initialization, object storage, tree creation, and commit management.
init: Initialize a new Git repositorycat-file: Display the contents of a Git objecthash-object: Compute object ID and optionally creates a blob from a filels-tree: List the contents of a tree objectwrite-tree: Create a tree object from the current indexcommit-tree: Create a new commit objectclone: Clone a remote repository
- Go 1.22 or later
- Bash shell (for running the provided script)
- Clone the repository:
git clone <repository-url>
cd git-go- Make the run script executable:
chmod +x run.shThe project provides a wrapper script run.sh that builds and executes the Git implementation. All commands should be run through this script:
./run.sh <command> [arguments...]./run.sh init./run.sh hash-object -w <file>./run.sh cat-file -p <sha>./run.sh ls-tree --name-only <sha>./run.sh write-tree./run.sh commit-tree <tree-sha> -p <parent-sha> -m <message>./run.sh clone <repository-url>