Purpose
Cleanup stale tag git artifacts by age and pattern.
Location
git/tag/cleanup.sh
Preconditions
- Required tools:
bash,find - Required permissions: delete permission on target path
- Required environment variables: none
Arguments
| Flag | Required | Default | Description |
|---|---|---|---|
--path DIR |
No | .git |
Directory to clean |
--days N |
No | 30 |
Age threshold |
--pattern GLOB |
No | * |
File glob |
--dry-run |
No | false |
Print matches only |
Usage
git/tag/cleanup.sh --path .git --days 7 --pattern '*tmp*' --dry-run
Output
- Exit codes:
0success,2invalid arguments.