# How to Retrieve and Compare Code for Two WandB Experiments with Git State?

**URL:** <https://community.wandb.ai/t/how-to-retrieve-and-compare-code-for-two-wandb-experiments-with-git-state/8640>\
**Category:** W&B Help\
**Tags:** artifacts, wandb\
**Created:** [December 23, 2024, 10:47am UTC](https://community.wandb.ai/t/how-to-retrieve-and-compare-code-for-two-wandb-experiments-with-git-state/8640 "2024-12-23T10:47:09Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![gonyrosenman](https://avatars.discourse-cdn.com/v4/letter/g/919ad9/32.png) [@gonyrosenman](https://community.wandb.ai/u/gonyrosenman)\
**Post date:** [December 23, 2024, 10:47am UTC](https://community.wandb.ai/t/how-to-retrieve-and-compare-code-for-two-wandb-experiments-with-git-state/8640/1 "2024-12-23T10:47:09Z")

</div>

Hi all,

I have two experiments logged in WandB with nearly identical configurations, but one crashed, and the other completed successfully. Each experiment logs a Git state with a branch name and commit hash, like this:

```auto
git checkout -b "branch_name" <commit_hash>

```

However:

1. I can’t retrieve one of the commit hashes locally—`git checkout` gives me a “bad object” error, and it’s not found with `git fetch --all`.
2. In the WandB code directory, I only see the main module that launches the experiment. In my case, it’s just:

```auto
from trainer import train
train()

```

I suspect the branch and commit were only created in the environment where the training job ran and were not pushed to the remote repository.

### Question:

- Can I retrieve the full code or Git state directly from WandB or the environment?
- Does the branch/hash information in WandB mean the code is accessible, and if so, how do I retrieve it?
- Are there best practices to ensure such states are reproducible for debugging?

Thanks in advance!
