I was looking for a way to quickly see a state of repository in terms of branches and tags (that is, getting a list of all existing branches and tags, as well as the commits they point to with dates), so as to see if there are later commits than the current HEAD after cloning; and after some research, came up with the following command (git version 1.9.1):
git --no-pager log \
--simplify-by-decoration \
--tags --branches --remotes \
--date-order \
--decorate \
--pretty=tformat:"%Cblue %h %Creset %<(25)%ci %C(auto)%d%Creset %s"
Note that, apparently, --all can be used instead of --tags --branches --remotes (and also, tformat because custom log format omits newline at end of output)
The output is like this:
However, when I look at How can I get a list of git branches, ordered by most recent commit? , most answers use git for-each-ref, so I'd like to confirm - is there anything the above git log command would miss, in terms of all branches, tags and remotes? If so, is git for-each-ref the command I should use, or is there some other command to list them all?
(Bonus question - is it possible to modify this format, to also print the branch in which a given tag was added? Also, any way to get the star|asterisk indicating the current checked out state when using git branch -a?)
