The -r flag reverses the output, making the newest branch commit date at the top. Sort command is somewhat magical, as it is able to deduce the beginning of each output line is a date and sort by that date. | sort -r pipes the final looped output to the sort command.\\t$k prints a tab and then writes the k value, which is the name of the branch.- | head -n 1 pipes the git show output into the head command, which just returns the first line -n 1 ensures only the first line is shown.You can read more about pretty=format: here. Adding the pretty=format: allows the default date structure to be changed and coloured, making the output more legible and informative. git show shows the change date as well as the changes of the k branch. As a workaround, you can list all potentially-interesting commits (with git rev-list or equivalent, such as git log: use whatever specifier makes commits potentially interesting, except for date filters: in this case that's just -all) and extract all of their author-date fields (with git log -formatat or whatever), then do your own pruning. List remote Git branches and the last commit date for each branch.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |