Git muestra los archivos que se han cambiado en los últimos 2 días
¿Cómo puedo tener una lista con todos los archivos que se han cambiado en los últimos 2 días? Sé acerca de
git log --name-status --since="2 days ago"
Pero esto me mostrará ids, fechas y mensajes de confirmación. Todo lo que necesito es la lista de los nombres de archivo que se cambiaron.
Es posible con git?
5 answers
git log --pretty=format: --name-only --since="2 days ago"
Si algunos archivos se duplican en varias confirmaciones, puede usar pipe para filtrarlo
git log --pretty=format: --name-only --since="2 days ago" | sort | uniq
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2011-09-21 13:42:56
git diff --stat @{2.days.ago}
Breve y eficaz
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2013-11-24 04:15:24
Use la opción raw raw para git log:
$ git log --raw --since=2.days
Vea la parte di diff-filter de la página de ayuda de git log para la explicación de las banderas que se muestran en el formato raw raw. Ellos explican lo que sucede con los archivos en cada commit:
--diff-filter=[(A|C|D|M|R|T|U|X|B)...[*]]
Select only files that are Added (A), Copied (C), Deleted (D),
Modified (M), Renamed (R), have their type (i.e. regular file,
symlink, submodule, ...) changed (T), are Unmerged (U), are Unknown
(X), or have had their pairing Broken (B). Any combination of the
filter characters (including none) can be used. When *
(All-or-none) is added to the combination, all paths are selected
if there is any file that matches other criteria in the comparison;
if there is no file that matches other criteria, nothing is
selected.
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2011-09-21 13:43:44
Puede hacer una diferencia de una versión que es más cercana a hace 2 días con:
git diff $(git log -1 --before="2 days ago" --format=%H).. --stat
--stat
le da un resumen de los cambios. Agregue --name-only
para excluir cualquier meta información y tener solo una lista de nombres de archivo.
Espero que esto ayude.
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2011-09-21 18:02:49
git log --pretty="format:" --since="2 days ago" --name-only
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2011-09-21 22:37:16