# \#challenge:git

**URL:** https://forum.codecrafters.io/tag/challenge-git/3.md

[Latest](https://forum.codecrafters.io/latest.md) · [Categories](https://forum.codecrafters.io/categories.md) · [Tags](https://forum.codecrafters.io/tags.md)

---

## [Upgrade Git in Zig to 0.16.0](https://forum.codecrafters.io/t/upgrade-git-in-zig-to-0-16-0/16224)

<div class="topic-metadata">

**Author:** [@MrNemo64](https://forum.codecrafters.io/u/MrNemo64)\
**Replies:** 2\
**Last updated:** [September 8, 2026, 12:47pm UTC](https://forum.codecrafters.io/t/upgrade-git-in-zig-to-0-16-0/16224 "2026-09-08T12:47:36Z")

</div>

I just tried out the Git in Zig but it is still using 0.15.1. Is there a plan to upgrade this? I have noticed that other challenges (Interpreter for example) already use 0.16.0 so is it just in the pipeline to be updated…

---

## [Elixir track now supports Git](https://forum.codecrafters.io/t/elixir-track-now-supports-git/16094)

<div class="topic-metadata">

**Author:** [@andy1li](https://forum.codecrafters.io/u/andy1li)\
**Replies:** 0\
**Last updated:** [May 7, 2026, 4:43pm UTC](https://forum.codecrafters.io/t/elixir-track-now-supports-git/16094 "2026-05-07T16:43:59Z")

</div>

Hey everyone! The Elixir track now includes the Build your own Git challenge. Ready to put your Elixir skills to the test? Jump into the Elixir track, and let us know how it goes!

---

## [OCaml track now supports Git](https://forum.codecrafters.io/t/ocaml-track-now-supports-git/16052)

<div class="topic-metadata">

**Author:** [@andy1li](https://forum.codecrafters.io/u/andy1li)\
**Replies:** 0\
**Last updated:** [April 16, 2026, 7:54pm UTC](https://forum.codecrafters.io/t/ocaml-track-now-supports-git/16052 "2026-04-16T19:54:43Z")

</div>

Hey everyone! The OCaml track now includes the Build your own Git challenge. Ready to put your OCaml skills to the test? Jump into the OCaml track, and let us know how it goes!

---

## [Git stage FE4 deviates from real Git implementation](https://forum.codecrafters.io/t/git-stage-fe4-deviates-from-real-git-implementation/15743)

<div class="topic-metadata">

**Author:** [@SanderBlok](https://forum.codecrafters.io/u/SanderBlok)\
**Replies:** 2\
**Last updated:** [January 14, 2026, 6:09pm UTC](https://forum.codecrafters.io/t/git-stage-fe4-deviates-from-real-git-implementation/15743 "2026-01-14T18:09:27Z")

</div>

First of all I want to say I loved this challenge (including the painful git clone stage)! I decided to go a bit further and add more Git functionality to my implementation, such as the index. Then I decided to move the …

---

## [(#FE4) Program logs cause false-negative test](https://forum.codecrafters.io/t/fe4-program-logs-cause-false-negative-test/15670)

<div class="topic-metadata">

**Author:** [@natalka1122](https://forum.codecrafters.io/u/natalka1122)\
**Replies:** 5\
**Last updated:** [December 17, 2025, 10:14am UTC](https://forum.codecrafters.io/t/fe4-program-logs-cause-false-negative-test/15670 "2025-12-17T10:14:54Z")

</div>

My solution writes logs. In stderr and in the folder “logs”. Frequent logs. In this task I have to scan all the files in the current folder and calculate their hashes. I do such thing but during this I am writing stuf i…

---

## [Stuck at Write a tree object #fe4. The program is printing 40 char SHA yet the tester expects it](https://forum.codecrafters.io/t/stuck-at-write-a-tree-object-fe4-the-program-is-printing-40-char-sha-yet-the-tester-expects-it/15488)

<div class="topic-metadata">

**Author:** [@vardey](https://forum.codecrafters.io/u/vardey)\
**Replies:** 2\
**Last updated:** [November 4, 2025, 6:30am UTC](https://forum.codecrafters.io/t/stuck-at-write-a-tree-object-fe4-the-program-is-printing-40-char-sha-yet-the-tester-expects-it/15488 "2025-11-04T06:30:29Z")

</div>

I’m stuck on Stage Write a tree object #fe4 My program prints 40-char SHA but the test still fails. The “Got:” field is empty. Am I printing it wrong? Here are my logs: remote: \[your\_program\] Initialized git director…

---

## [Error "file is not Zlib-compressed"](https://forum.codecrafters.io/t/error-file-is-not-zlib-compressed/15422)

<div class="topic-metadata">

**Author:** [@Nyerelia](https://forum.codecrafters.io/u/Nyerelia)\
**Replies:** 2\
**Last updated:** [October 22, 2025, 8:46am UTC](https://forum.codecrafters.io/t/error-file-is-not-zlib-compressed/15422 "2025-10-22T08:46:42Z")

</div>

Hello. I’m at the finish line of #JT4 (Create a blob object) but I get the following error when running the test: remote: \[your\_program\] Logs from your program will appear here! remote: \[your\_program\] Initialized git di…

---

## [Challenge:git Stage #FE4 - Git object miss match](https://forum.codecrafters.io/t/challenge-git-stage-fe4-git-object-miss-match/15357)

<div class="topic-metadata">

**Author:** [@Gensune](https://forum.codecrafters.io/u/Gensune)\
**Replies:** 4\
**Last updated:** [October 19, 2025, 1:06am UTC](https://forum.codecrafters.io/t/challenge-git-stage-fe4-git-object-miss-match/15357 "2025-10-19T01:06:14Z")

</div>

I’m stuck on Stage #FE4. I’ve tried to refactor how I create the object in the createTree() method. however, no matter what I try it keeps telling me that the git objects don’t match. I do see that the Tree may be the …

---

## [Error with the test in Stage 6 with Kotlin](https://forum.codecrafters.io/t/error-with-the-test-in-stage-6-with-kotlin/15399)

<div class="topic-metadata">

**Author:** [@Sajeg](https://forum.codecrafters.io/u/Sajeg)\
**Replies:** 2\
**Last updated:** [October 15, 2025, 2:32pm UTC](https://forum.codecrafters.io/t/error-with-the-test-in-stage-6-with-kotlin/15399 "2025-10-15T14:32:34Z")

</div>

Hello there, At the moment I’m doing the git challenge with Kotlin. However with the test on Stage 6 there seems to be an issue. The output of the tester is like that: \[compile\] Compilation successful. \[tester::#JM9\] R…

---

## [How to acces app/main.js](https://forum.codecrafters.io/t/how-to-acces-app-main-js/15397)

<div class="topic-metadata">

**Author:** [@AscendedKoala](https://forum.codecrafters.io/u/AscendedKoala)\
**Replies:** 2\
**Last updated:** [October 13, 2025, 9:19am UTC](https://forum.codecrafters.io/t/how-to-acces-app-main-js/15397 "2025-10-13T09:19:46Z")

</div>

I am very new to coding but i want to challenge myself so i wanted to try setting up a git or redis which is maybe very unwise but the issue im running into is the very first hurdle. After cloning the repository and set…

---

## [\[Git\] How to pass the first stage? Expected the ".git/HEAD" file to be created](https://forum.codecrafters.io/t/git-how-to-pass-the-first-stage-expected-the-git-head-file-to-be-created/15330)

<div class="topic-metadata">

**Author:** [@zuamsyah2](https://forum.codecrafters.io/u/zuamsyah2)\
**Replies:** 3\
**Last updated:** [September 24, 2025, 2:40am UTC](https://forum.codecrafters.io/t/git-how-to-pass-the-first-stage-expected-the-git-head-file-to-be-created/15330 "2025-09-24T02:40:15Z")

</div>

Checklist: :white\_check\_mark: : I’ve uncommented the code. :white\_check\_mark: : I’ve saved the changes. :white\_check\_mark: : I’ve run the git commands: git commit -am "\[seeking help on forum\]" git push origin master …

---

## [Your-program.sh doesn't work](https://forum.codecrafters.io/t/your-program-sh-doesnt-work/15271)

<div class="topic-metadata">

**Author:** [@Nyerelia](https://forum.codecrafters.io/u/Nyerelia)\
**Replies:** 2\
**Last updated:** [September 11, 2025, 9:41am UTC](https://forum.codecrafters.io/t/your-program-sh-doesnt-work/15271 "2025-09-11T09:41:35Z")

</div>

I did install vcpkg as recommended (which is not obvious and took me a while to find that information) but it still fails. I’ve searched and tried various stuff but I can’t get it to work, so I left it as it was original…

---

## [Character spacing in ls-tree command output (Ruby)](https://forum.codecrafters.io/t/character-spacing-in-ls-tree-command-output-ruby/15243)

<div class="topic-metadata">

**Author:** [@one-ant](https://forum.codecrafters.io/u/one-ant)\
**Replies:** 8\
**Last updated:** [September 8, 2025, 8:13am UTC](https://forum.codecrafters.io/t/character-spacing-in-ls-tree-command-output-ruby/15243 "2025-09-08T08:13:32Z")

</div>

I’m stuck on Stage #kp1 Read a Tree Object. Well, not quite stuck, but I have an issue with the output. Here is my output: \> ruby app/main.rb ls-tree ff6701c8e530eba2971947371969961b452a262b 040000 tree ee82ed095fba59c…

---

## [Blocked at parsing packfile for git-clone](https://forum.codecrafters.io/t/blocked-at-parsing-packfile-for-git-clone/15190)

<div class="topic-metadata">

**Author:** [@Rico-CHEH](https://forum.codecrafters.io/u/Rico-CHEH)\
**Replies:** 3\
**Last updated:** [August 27, 2025, 8:35pm UTC](https://forum.codecrafters.io/t/blocked-at-parsing-packfile-for-git-clone/15190 "2025-08-27T20:35:10Z")

</div>

I’m stuck on the last stage of recreating git, I got to the point where the server responds with the packfile. However I don’t understand how I’m supposed to parse it when there are multiple objects, as the size that is …

---

## [Ls-tree: Test randomness and lack of debug](https://forum.codecrafters.io/t/ls-tree-test-randomness-and-lack-of-debug/15083)

<div class="topic-metadata">

**Author:** [@JSchneidler](https://forum.codecrafters.io/u/JSchneidler)\
**Replies:** 4\
**Last updated:** [August 21, 2025, 4:18pm UTC](https://forum.codecrafters.io/t/ls-tree-test-randomness-and-lack-of-debug/15083 "2025-08-21T16:18:11Z")

</div>

Looking for help, but also providing feedback. In the tests for ls-tree, it seems 3 randomly named files are generated to test the sorting/ordering of the output. In this case, it is “blueberry”, “pear”, and “mango”. Wh…

---

## [ALWAYS having "Everything up-to-date" in git push](https://forum.codecrafters.io/t/always-having-everything-up-to-date-in-git-push/14135)

<div class="topic-metadata">

**Author:** [@LuizGuilhermeGO](https://forum.codecrafters.io/u/LuizGuilhermeGO)\
**Replies:** 5\
**Last updated:** [July 30, 2025, 12:09am UTC](https://forum.codecrafters.io/t/always-having-everything-up-to-date-in-git-push/14135 "2025-07-30T00:09:33Z")

</div>

I’m being have stuck trying to do ‘git push origin master’, but is always send this log: Everything up-to-date I tried to create a empty commit, see the HEAD from the last commit, but everthing seems ok, what should i …

---

## [\[Java\] Stuck at write-tee](https://forum.codecrafters.io/t/java-stuck-at-write-tee/13401)

<div class="topic-metadata">

**Author:** [@Widua](https://forum.codecrafters.io/u/Widua)\
**Replies:** 1\
**Last updated:** [July 13, 2025, 4:00am UTC](https://forum.codecrafters.io/t/java-stuck-at-write-tee/13401 "2025-07-13T04:00:13Z")

</div>

I coded solution for write-tree command. And when I’m testing it it outputs the same SHA-1 as git, after zlib-decompression files looks 1:1, zlib-compressed file also looks the same for git implementation, and for my imp…

---

## [\[C++\] Configuring the CPR library in cmake](https://forum.codecrafters.io/t/c-configuring-the-cpr-library-in-cmake/12533)

<div class="topic-metadata">

**Author:** [@ahhmed-hassan](https://forum.codecrafters.io/u/ahhmed-hassan)\
**Replies:** 4\
**Last updated:** [June 24, 2025, 8:49pm UTC](https://forum.codecrafters.io/t/c-configuring-the-cpr-library-in-cmake/12533 "2025-06-24T20:49:25Z")

</div>

I’m stuck on Stage #(6) for clone. It is more a question about CMake itself but this is the first time I needed to make HTTP request. I’ve tried different things related to this PR request cpr-config.cmake for find\_pack…

---

## [Clarification needed for how many bytes to read](https://forum.codecrafters.io/t/clarification-needed-for-how-many-bytes-to-read/10499)

<div class="topic-metadata">

**Author:** [@Nicholas-EG](https://forum.codecrafters.io/u/Nicholas-EG)\
**Replies:** 1\
**Last updated:** [May 17, 2025, 11:20am UTC](https://forum.codecrafters.io/t/clarification-needed-for-how-many-bytes-to-read/10499 "2025-05-17T11:20:08Z")

</div>

I’m stuck on Stage #MG6. When dealing with Git objects in the pack file, I understand that the object header encodes information about the object type and the size of the object. Can someone clarify if the size is refer…

---

## [Why is my code throwing error? Please help](https://forum.codecrafters.io/t/why-is-my-code-throwing-error-please-help/8780)

<div class="topic-metadata">

**Author:** [@masterfighter999](https://forum.codecrafters.io/u/masterfighter999)\
**Replies:** 2\
**Last updated:** [April 28, 2025, 12:47pm UTC](https://forum.codecrafters.io/t/why-is-my-code-throwing-error-please-help/8780 "2025-04-28T12:47:34Z")

</div>

import sys import os import zlib import hashlib import json import time from pathlib import Path from datetime import datetime GIT\_DIR = ".git" OBJECTS\_DIR = os.path.join(GIT\_DIR, "objects") INDEX\_FILE = os.path.join(GI…

---

## [\#JM9 tests git cat-file commit \<sha\> (in Go)](https://forum.codecrafters.io/t/jm9-tests-git-cat-file-commit-sha-in-go/9255)

<div class="topic-metadata">

**Author:** [@ptrhcpang](https://forum.codecrafters.io/u/ptrhcpang)\
**Replies:** 2\
**Last updated:** [April 24, 2025, 11:12am UTC](https://forum.codecrafters.io/t/jm9-tests-git-cat-file-commit-sha-in-go/9255 "2025-04-24T11:12:23Z")

</div>

I’m stuck on Stage #JM9. I believe I have written a commit, and it generates a commit sha. However, when I push my code to Codecrafters, I get the following odd error: It appears that my program is generating a comm…

---

## [\[Git\] How to pass the first stage?](https://forum.codecrafters.io/t/git-how-to-pass-the-first-stage/4387)

<div class="topic-metadata">

**Author:** [@franciscom06](https://forum.codecrafters.io/u/franciscom06)\
**Replies:** 2\
**Last updated:** [March 30, 2025, 4:45pm UTC](https://forum.codecrafters.io/t/git-how-to-pass-the-first-stage/4387 "2025-03-30T16:45:08Z")

</div>

Checklist: :white\_check\_mark: or :x:: I’ve uncommented the code. :white\_check\_mark: or :x:: I’ve saved the changes. :white\_check\_mark: or :x:: I’ve run the git commands: git commit -am "\[seeking help on forum\]" git pu…

---

## [\[Python\]\[#FE4\] write tree - object content differs](https://forum.codecrafters.io/t/python-fe4-write-tree-object-content-differs/6843)

<div class="topic-metadata">

**Author:** [@neerajnangireddy](https://forum.codecrafters.io/u/neerajnangireddy)\
**Replies:** 5\
**Last updated:** [March 17, 2025, 2:58pm UTC](https://forum.codecrafters.io/t/python-fe4-write-tree-object-content-differs/6843 "2025-03-17T14:58:53Z")

</div>

I’m stuck on Stage #FE4. I have implemented a recursive write tree but the output differs. Here are my logs: \[user@fedora codecrafters-git-python\]$ codecrafters test Initiating test run... ⏳ Turbo test runners busy. …

---

## [\[Java\]\[#MG6\] zlib error after parsing many objects successfully](https://forum.codecrafters.io/t/java-mg6-zlib-error-after-parsing-many-objects-successfully/6363)

<div class="topic-metadata">

**Author:** [@HowieTKL](https://forum.codecrafters.io/u/HowieTKL)\
**Replies:** 3\
**Last updated:** [March 17, 2025, 7:39am UTC](https://forum.codecrafters.io/t/java-mg6-zlib-error-after-parsing-many-objects-successfully/6363 "2025-03-17T07:39:31Z")

</div>

I’m stuck on the last Stage #MG6 while parsing Pack objects I get an inflation error after successfully parsing dozens or even over a hundred objects. Failure is consistently in the same spot for a given repo. But other…

---

## [Error failed to push some refs to 'origin'](https://forum.codecrafters.io/t/error-failed-to-push-some-refs-to-origin/4903)

<div class="topic-metadata">

**Author:** [@heto66](https://forum.codecrafters.io/u/heto66)\
**Replies:** 1\
**Last updated:** [March 16, 2025, 7:27am UTC](https://forum.codecrafters.io/t/error-failed-to-push-some-refs-to-origin/4903 "2025-03-16T07:27:56Z")

</div>

Checklist: :white\_check\_mark: : I’ve uncommented the code. :white\_check\_mark: : I’ve saved the changes. :white\_check\_mark:: I’ve run the git commands: git commit -am “\[any message\]”, git push origin master Here’s a s…

---

## [\[Python\]\[#MG6\] Clone command - stuck on tree checkout](https://forum.codecrafters.io/t/python-mg6-clone-command-stuck-on-tree-checkout/4747)

<div class="topic-metadata">

**Author:** [@eaverdeja](https://forum.codecrafters.io/u/eaverdeja)\
**Replies:** 14\
**Last updated:** [February 13, 2025, 11:04am UTC](https://forum.codecrafters.io/t/python-mg6-clone-command-stuck-on-tree-checkout/4747 "2025-02-13T11:04:54Z")

</div>

I’m facing an error during the tree checkout step, almost at the end of the clone operation and would like some help debugging. For context, cloning is already working for a small repository :tada: (.venv) ➜ codecraf…

---

## [Question about #JM9 and \`git show\`](https://forum.codecrafters.io/t/question-about-jm9-and-git-show/4712)

<div class="topic-metadata">

**Author:** [@eaverdeja](https://forum.codecrafters.io/u/eaverdeja)\
**Replies:** 8\
**Last updated:** [February 7, 2025, 10:36pm UTC](https://forum.codecrafters.io/t/question-about-jm9-and-git-show/4712 "2025-02-07T22:36:51Z")

</div>

My tests are passing and I’m ready to move on to the final boss, but I have a question about this stage first. The instructions state that: To verify your changes, the tester will read the commit object from the .git d…

---

## [\#FE4 - mismatch on tree length](https://forum.codecrafters.io/t/fe4-mismatch-on-tree-length/4487)

<div class="topic-metadata">

**Author:** [@eaverdeja](https://forum.codecrafters.io/u/eaverdeja)\
**Replies:** 4\
**Last updated:** [February 6, 2025, 10:39pm UTC](https://forum.codecrafters.io/t/fe4-mismatch-on-tree-length/4487 "2025-02-06T22:39:29Z")

</div>

I’m stuck on Stage #FE4. Test logs tell me there’s a mismatch on the tree’s length, but I’m not really sure why. My implementation seems to work since git ls-tree can read the tree object just fine: Here are my logs: …

---

## [Step for git-clone (implementing the git protocol)](https://forum.codecrafters.io/t/step-for-git-clone-implementing-the-git-protocol/4407)

<div class="topic-metadata">

**Author:** [@i27ae15](https://forum.codecrafters.io/u/i27ae15)\
**Replies:** 2\
**Last updated:** [January 26, 2025, 7:36pm UTC](https://forum.codecrafters.io/t/step-for-git-clone-implementing-the-git-protocol/4407 "2025-01-26T19:36:22Z")

</div>

Hi, everybody, I have created a doc on the steps to follow to complete the last stage of the codecrafters challenge on git → git clone. I have only created the description on how things should work and a clearer way on …

---

## [\[Solved\]: Test fails because they start again automatically (tester::#GG4)](https://forum.codecrafters.io/t/solved-test-fails-because-they-start-again-automatically-tester-gg4/4244)

<div class="topic-metadata">

**Author:** [@yiannis13](https://forum.codecrafters.io/u/yiannis13)\
**Replies:** 3\
**Last updated:** [January 22, 2025, 4:10pm UTC](https://forum.codecrafters.io/t/solved-test-fails-because-they-start-again-automatically-tester-gg4/4244 "2025-01-22T16:10:10Z")

</div>

I’m stuck on Stage Read a blob object. Test fails because they start again automatically. Logs: \[your\_program\] dumpty yikes dumpty yikes yikes horsey 28 \[tester::#IC4\] Output is valid. 29 \[tester::#IC4\] Test pa…

[Next page](https://forum.codecrafters.io/tag/challenge-git/3.md?match_all_tags=true&page=1&tags%5B%5D=challenge%3Agit)
