# find_git_dir

> **Function** in `deepagents_code`

📖 [View in docs](https://reference.langchain.com/python/deepagents-code/_git/find_git_dir)

Locate the effective git metadata directory for a path.

## Signature

```python
find_git_dir(
    path: str | Path,
) -> Path | None
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `path` | `str \| Path` | Yes | Directory or file path inside a repository. |

## Returns

`Path | None`

The git metadata directory for the repository containing `path`, or

---

[View source on GitHub](https://github.com/langchain-ai/deepagents/blob/0412009c5441bef8d75a427e1da8909e33ab5b56/libs/code/deepagents_code/_git.py#L110)