Skip to main content

TinyGit - Version Control

·310 words·2 mins
Dusan Lecic
Author
Dusan Lecic
Seeking mastery
Table of Contents

TinyGit
#

duolok/tinygit

Simplistic Version Control Software

Go
0
0

About
#

Small version control system written in Go, inspired by Git. I wrote this in a span of a few days. I wanted to see how fast can I make it and how functional it can be.

Installation
#

# Clone the repository
git clone https://github.com/yourusername/tinygit.git

# Build the project
cd tinygit
go build -o tinygit

# Make it executable (for Unix-based systems)
chmod +x tinygit

Basic Commands
#

Command Description
--config {NAME} Set the author name for commits
--add {FILE_NAME} Track a file
--commit {MESSAGE} Save changes to tracked files with a commit message
--log Display all commits
--checkout {COMMIT_HASH} Switch to a specific commit
--show-commit {COMMIT_HASH} Display metadata for a specific commit
--tracked-files Show all currently tracked files
--help Display help information

Command Details
#

Configure Author
#

./tinygit --config {NAME}

Sets the author name for your commits.

Track Files
#

./tinygit --add {FILE_NAME}

Adds a file to the list of tracked files.

Commit Changes
#

./tinygit --commit "Your commit message"

Creates a new commit with the current state of all tracked files. The commit includes the provided message and the configured author name.

View Commit History
#

./tinygit --log

Displays a list of all commits, including their hash, author, date, and message.

Switch Between Commits
#

./tinygit --checkout {COMMIT_HASH}

Restores the state of all files to a previous commit.

Show Commit Metadata
#

./tinygit --show-commit {COMMIT_HASH}

Displays details of a specific commit, including the author, date, and message.

Show Tracked Files
#

./tinygit --tracked-files

Lists all files currently being tracked by TinyGit.

Get Help
#

./tinygit --help

Displays a list of available commands and their descriptions.

Contributing
#

If you’d like to contribute to TinyGit, feel free to submit issues or pull requests on the repository.

License
#

This project is licensed under the MIT License.