# resolve_git_commit_sha

> **Function** in `deepagents_code`

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

Resolve the current `HEAD` commit SHA, filesystem-first.

## Signature

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

## Parameters

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

## Returns

`str`

The full commit SHA, or an empty string when none can be determined.

---

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