oh-my-git/levels/low-level/ref-remove
2024-07-11 10:38:19 +02:00

41 lines
No EOL
971 B
Text

[descripción]
Y finalmente, para eliminar una referencia, use
git update-ref -d refs/<nombre de referencia>
¡Elimina todas las referencias! :P (Bueno, excepto HEAD. HEAD es especial).
[configuración]
eco hola > hola
eco mundo > mundo
BLOB1=$(git hash-object -w hola)
BLOB2=$(git hash-object -w mundo)
git agregar.
ÁRBOL=$(git escribir-árbol)
COMMIT=$(git commit-tree $TREE -m "Compromiso inicial")
git update-ref refs/best_blob_ever "$BLOB1"
git update-ref refs/beautiful_commit "$COMMIT"
[objetivo de configuración]
eco hola > hola
eco mundo > mundo
BLOB1=$(git hash-object -w hola)
BLOB2=$(git hash-object -w mundo)
git agregar.
ÁRBOL=$(git escribir-árbol)
COMMIT=$(git commit-tree $TREE -m "Compromiso inicial")
git update-ref refs/best_blob_ever "$BLOB1"
git update-ref refs/beautiful_commit "$COMMIT"
para REF en $(git for-each-ref --format='%(refname)'); hacer
git actualización-ref -d "$REF"
hecho
[ganar]
prueba "$(git show-ref | wc -l)" -eq 0