GIT CAT-FILE
Afficher le type d’un objet à partir de son empreinte SHA1 :
git cat-file -t SHA1
ex :
$ git cat-file -t fe23c7d2e36d42a14711a0edd384436ac00ac2e2 commit $ git cat-file -t e442a3cc10497501f6f7f49b759a61c27cc585e1 tree $ git cat-file -t 20415af9af697db1a651ef950433b71211988c28 blob
Afficher le contenu d’un objet à partir de son empreinte SHA1 :
git cat-file -p SHA1
ex :
$ git cat-file -p fe23c7d2e36d42a14711a0edd384436ac00ac2e2 tree e442a3cc10497501f6f7f49b759a61c27cc585e1 parent adc2a9b6011eb06345abd318a206bb9b878f4f41 author darwinos <darwinos@example.com> 1529068305 +0200 committer darwinos <darwinos@example.com> 1529068305 +0200 Modif longueur.sh : retour à la v1.1 $ git cat-file -p e442a3cc10497501f6f7f49b759a61c27cc585e1 00644 blob 90ab30c8b35f2951feefae21992b7696d4e378e9 README.md 100644 blob ed1604c621f8d4d369e1db4b78dcf40991cc8a27 file1.txt 100644 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 file4.txt 100644 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 file6.txt 100644 blob 20415af9af697db1a651ef950433b71211988c28 longueur.sh $ git cat-file -p 20415af9af697db1a651ef950433b71211988c28 #!/usr/bin/env python3 import sys def taille(s) : if not s : return 0 return 1 + taille(s[1:]) for x in sys.argv[1:] : print(taille(x))