Skip to content

mmilburn/codecrafters-git-python

Repository files navigation

About the Project

This is a finished Python implementation for the "Build Your Own Git" Challenge. This code implements functionality for all stages (and extensions) of the challenge as of 2025-02-13.

What git Commands Are Implemented?

  • init
  • cat-file
  • hash-object
  • ls-tree
  • write-tree
  • commit-tree (author and committer are hardcoded, message is not)
  • clone

Running Locally

The your_git.sh script is expected to operate on the .git folder inside the current working directory. If you're running this inside the root of this repository, you might end up accidentally damaging the repository's .git folder.

It is recommended to execute your_git.sh in a different folder when running locally. For example:

mkdir -p /tmp/testing && cd /tmp/testing
/path/to/your/repo/your_git.sh init

To make this easier to type out, you could add a shell alias:

alias mygit=/path/to/your/repo/your_git.sh

mkdir -p /tmp/testing && cd /tmp/testing
mygit init

Test Run Video

Here's a video of the code being run in the codecrafters test environment:

codecrafters-git-python-test-run-av1.webm

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors