Get commit date of a given SHA1 (submodules) commit

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

  • What are the differences between .gitignore and .gitkeep?
  • Delete broken branch in git
  • Git keep creating wrong files
  • Sourcetree 2.1.2.5 - Shows “Uncommitted changes” yet nothing is pending
  • Restrict developers access on GitHub repository
  • eGit Merge Resolution - Use Your Copy
  • code.google.com: git: fatal: remote error: Repository not found
  • Change bitbucket repository name on local project
  • Beyond Compare as a Diff tool with Git - How to command line switch like: /expandall
  • Git fetch a single commit
  • Any benefit keeping old branches on GitHub?
  • Splitting a commit in GIT
  • One Solution collect form web for “Get commit date of a given SHA1 (submodules) commit”

    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> 
    
    Git Baby is a git and github fan, let's start git clone.