Skip to content

tudormatei/git-clone

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 

Repository files navigation

Git Clone

A minimal, educational implementation of core Git features in Python.

Overview

This project is a personal learning exercise, inspired by Ben Hoyt's "Build Your Own Git in Python". It implements a subset of Git's functionality, including repository initialization, object storage, staging, committing, status, diff, and pushing to a remote repository.

The code is written for clarity and educational purposes, not for production use.

Features

  • Initialize a new repository (init)
  • Add files to the index (add)
  • Commit staged changes (commit)
  • Show repository status (status)
  • Show diffs between index and working copy (diff)
  • List files in the index (ls-files)
  • Display object contents and info (cat-file)
  • Hash file contents as Git objects (hash-object)
  • Push commits to a remote repository (push)

Usage

Run commands using the pygit.py script:

python pygit.py init myrepo
cd myrepo
echo "hello" > hello.txt
python pygit.py add hello.txt
python pygit.py commit -m "Initial commit"
python pygit.py status

About

A minimal, educational implementation of core Git features in Python.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages