Clone superficiel Git

VérifiéSûr

Script pour créer un clone superficiel d'un dépôt Git dans un répertoire temporaire. Utile pour analyser localement le contenu d'un dépôt sans télécharger l'historique complet.

Spar Skills Guide Bot
DeveloppementDébutant
5002/06/2026
Claude CodeCursorWindsurfCopilotCodex
#git#shallow-clone#local-analysis#bash#repository

Recommandé pour

Notre avis

Effectue un clone superficiel d'un dépôt Git dans un répertoire temporaire pour une analyse locale.

Points forts

  • Évite d'utiliser des API web pour analyser le contenu d'un dépôt.
  • Rapide et économique en bande passante grâce au clone superficiel.
  • Nettoie automatiquement le répertoire temporaire après usage.

Limites

  • Ne récupère que l'historique récent (par défaut, un seul commit).
  • Nécessite que Git soit installé sur le système.
  • Le répertoire temporaire doit être supprimé manuellement après analyse.
Quand l'utiliser

Utilisez cette compétence lorsque vous avez besoin d'analyser localement le contenu d'un dépôt Git sans utiliser d'API web.

Quand l'éviter

Ne l'utilisez pas si vous avez besoin de l'historique complet du dépôt ou si vous devez travailler avec le dépôt à long terme.

Analyse de sécurité

Sûr
Score qualité80/100

The skill instructs to run a local script for shallow cloning a Git repository; no destructive or exfiltrating commands are present in the description, and the cleanup is user-initiated.

Aucun point d'attention détecté

Exemples

Shallow clone a public repository
Shallow clone the repository https://github.com/psf/requests.git to a temporary directory for analysis.
Clone a specific branch shallowly
Use shallow clone to get the 'main' branch of https://github.com/example/repo.git into a temp folder.
Analyze local copy of a repo
Clone https://github.com/angular/angular.git shallowly and then list the top-level files in the cloned directory.

name: git-shallow-clone description: Perform a shallow clone of a Git repository to a temporary location. allowed-tools: Bash

Shallow Clone

Provides a script for creating a shallow clone of a Git repository to a temporary location. This skill should be used to analyze repository contents locally instead of using web APIs.

Usage

Use the scripts/shallow-clone.sh script in this directory, for example:

./scripts/shallow-clone.sh <repository_url> [<tag_or_branch>]

The script will print the path to the cloned repository when done, for example:

$ ./scripts/shallow-clone.sh https://github.com/psf/requests.git
Cloning https://github.com/psf/requests.git (shallow, ref: HEAD) to /tmp/shallow-clone-DDqkuv...
/tmp/shallow-clone-DDqkuv/repo

After analyzing the local repository, clean up the temporary directory with:

$ rm -rf <path_to_temporary_directory>
Skills similaires