This simplified implementation of Git, written in Go, to help understand how Git works under the hood. It supports a subset of Git commands with a focus on clarity and correctness.
The following Git-like commands are currently implemented:
init
– Initialize a new repositoryadd
– Add files to the staging arearm
– Remove files from the staging area and working directorystatus
– Show the working tree statuscommit
– Record changes to the repositorylog
– Show commit logs
Clone the repository:
git clone https://github.com/yourusername/a-git.git
cd a-git
Build the binary:
go build -o a-git .
Commands work similarly to Git.
./a-git init
echo "Hello, world!" > hello.txt
./a-git add hello.txt
./a-git commit -m "Add hello.txt"
./a-git log