Reputation: 4615
very special problem: I have integrated submodules and I get my submodules 8-char long referenced commit state by
$ git ls-tree HEAD MY_SUBMODULE | awk '{print $3}' | cut -c -8
03B446AB
Now I want to get the commit date of the submodule, preferably in format yyyy-mm-dd. Do you have a idea how to handle this
Upvotes: 1
Views: 282
Reputation: 1327912
You could use the git show
command (for the committer date):
git --git-dir=/path/to/submodule/.git show --format="%ci" <commit>
The OP John Rumpel suggests in the comments:
git --git-dir=path/to/submodule/.git show --pretty=format:'%ad' --date=short <commit>
# or
git log --git-dir=path/to/submodule/.git --pretty=format:'%ad %h' --date=short | grep <commit>
Upvotes: 3