Broken Git LV1#2 Engineer Lab – Bug?

Hello,

I’ve been trying to complete the Git LV1#2 lab on the Kodekloud Engineer platform for over a month now, but I’ve had no success so far.

I’ve tested every possible scenario, documented all my steps, and still nothing works. Even my peer reviewers couldn’t figure out the issue. At this point, it genuinely seems to be a bug, which makes the experience quite frustrating.

I reached out to Kodekloud support, but they redirected me here for further assistance.

You can check my review video here: https://engineer.kodekloud.com/public-review?task_id=64071ffe741b204d59fbe97c&user_id=67a9b0b39c60bf3806e10c96
And here’s a small script I created after several retries: https://gist.github.com/nnosal/ed9451066250adde52adaacbcf2603ec

Unless I completely missed something, I believe this lab might be broken.
Could someone please help me take a look?

Thanks a lot for your help,
Best regards,
Nicolas

there is slight difference between running:

  • git clone /opt/test.git /usr/src/myrepos/
    this directly clones the /opt/test.git repository into /usr/src/myrepos/, it doesn’t create an additional folder test(name of the bare repo) under it.
  • cd /usr/src/myrepos/
    git clone /opt/test.git
    this will create a new folder inside the current directory named after the repo. /usr/src/myrepos/test/ This will be the actual cloned repository, in this case.

and maybe the test validation passes only if it finds that additional folder, so try it that way and see if it works.

2 Likes

That makes sense, and I can see how the difference in the cloning method could be the issue. I’ll give it a try and see if that resolves the problem. Appreciate your help

1 Like

Hey, thanks a lot for the clarification, I tested it your way and it works perfectly !

I get it now… we’re supposed just to cd $dest and then git clone $src, letting Git create the folder automatically.

Based on the instructions, I thought we were supposed to explicitly clone into the directory at the provided destination path. Honestly though, the instructions could have been a bit clearer to avoid this kind of confusion.

Sorry for the extra noise, and thanks again for your help!

1 Like

this works but this will create only test directory inside /usr/src/myrepos not other directories inside test directories like head,branches which present in /opt/test.git ,still it works i don’t no why? because in question they asked that Ensure no modifications are made to the repository during the cloning process.

/opt/test.git is a bare repository, which means it only contains the version control data (objects, refs, etc.) and no working directory.

When you clone it under /usr/src/myrepos, Git creates a new directory test inside /usr/src/myrepos.

  • Inside /usr/src/myrepos/test, you won’t see the same top-level directories like branches or objects directly.
  • Instead, you’ll see a working copy of the repository along with a hidden .git directory.
  • That .git directory contains all the internal structures (head, branches, etc.) that were originally inside /opt/test.git.

@sasiram hope this answers your doubt.

1 Like