Obtener la fecha de creación de un alijo
¿Hay alguna manera de saber cuándo se creó un alijo?
git stash list
solo enumera los escondites, y git stash show XXXXXX
muestra todos los archivos y cambios, pero no la fecha de la creación del escondite.
157
3 answers
Intenta:
git stash list --date=local
Debería imprimir algo como:
stash@{Thu Mar 21 10:30:17 2013}: WIP on master: 2ffc05b Adding resource
247
Author: Igor,
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-03-21 15:29:06
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-03-21 15:29:06
git show stash@{0}
también imprime la fecha, junto con la otra información.
14
Author: bcmcfc,
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-03-21 15:37:35
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-03-21 15:37:35
Puede utilizar --pretty=format
para lograr esto. Por ejemplo, esto produce una lista de alijos que incluye un tiempo relativo:
git stash list --pretty=format:"%C(red)%h%C(reset) - %C(dim yellow)(%C(bold magenta)%gd%C(dim yellow))%C(reset) %<(70,trunc)%s %C(green)(%cr) %C(bold blue)<%an>%C(reset)"
Tengo este conjunto en la sección [alias]
de mi archivo ~/.gitconfig
, para que pueda vincularlo a un simple comando sl
:
[alias]
co = checkout
lg = log --graph --pretty=format:\"%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset\" --abbrev-commit
rl = reflog --pretty=format:\"%Cred%h%Creset %C(auto)%gd%Creset %C(auto)%gs%C(reset) %C(green)(%cr)%C(reset) %C(bold blue)<%an>%Creset\" --abbrev-commit
sl = stash list --pretty=format:\"%C(red)%h%C(reset) - %C(dim yellow)(%C(bold magenta)%gd%C(dim yellow))%C(reset) %<(70,trunc)%s %C(green)(%cr) %C(bold blue)<%an>%C(reset)\"
(Puedes ver que también tengo marcas similares para log
y reflog
)
Si desea mostrar la fecha real, en lugar de una hora relativa, reemplace %(cr)
con %(ci)
.
14
Author: Lee Netherton,
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
2016-08-15 15:29:12
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
2016-08-15 15:29:12