# createGitCacheManager()

[**PromptScript API**](https://getpromptscript.dev/api-reference/index.md)

***

# Function: createGitCacheManager()

> **createGitCacheManager**(`options?`): [`GitCacheManager`](https://getpromptscript.dev/api-reference/resolver/src/classes/GitCacheManager/index.md)

Defined in: [resolver/src/git-cache-manager.ts:381](https://github.com/mrwogu/promptscript/blob/49aa50f943865b985366c4eda6e95c5a31ef39a6/packages/resolver/src/git-cache-manager.ts#L381)

Create a new GitCacheManager instance.

## Parameters

### options?

[`GitCacheManagerOptions`](https://getpromptscript.dev/api-reference/resolver/src/interfaces/GitCacheManagerOptions/index.md) = `{}`

Cache manager options

## Returns

[`GitCacheManager`](https://getpromptscript.dev/api-reference/resolver/src/classes/GitCacheManager/index.md)

GitCacheManager instance

## Example

```typescript
const cache = createGitCacheManager({
  cacheDir: '/custom/cache/path',
  ttl: 1800000, // 30 minutes
});

// Check if cache is valid
const isValid = await cache.isValid('https://github.com/org/repo.git', 'main');

// Get or create cache
const entry = await cache.get('https://github.com/org/repo.git', 'main');
```