File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -25,3 +25,27 @@ git reset --hard 8f19d216282d1516ad3fedf7b28e2bebb23b36c6
2525git push -f origin main
2626
2727</pre >
28+
29+
30+ ### Pre-commits
31+
32+ pre-commit solo analiza los archivos que están en el staging area (o sea, los que ya hiciste git add).
33+ <br >Si creas un archivo nuevo (echo "superdupersecret" > hola.txt) pero no lo agregas al índice, pre-commit no lo ve.
34+ <br >
35+ <pre >
36+
37+ ### Ejemplo:
38+
39+ echo "superdupersecret" > hola.txt
40+ git add hola.txt
41+ git commit -m "nuevo archivo"
42+ # antes de hacer el push...
43+ pre-commit run --all-files
44+
45+
46+
47+ ### Resumen
48+
49+ Archivos nuevos necesitas git add antes de que pre-commit los vea.
50+ Archivos en staging se analizan automáticamente en cada git commit.
51+ Revisión global usa pre-commit run --all-files.
You can’t perform that action at this time.
0 commit comments