"3. By default, git log
prints the commit, author's name and email ID, timestamp, and the commit message. However, the information isn't very graphical, especially if you want to see branches and merges. To display this information and limit some of the other data, you can use the following options with git log
: $ git log --decorate --graph --oneline --all
" ("Viewing the DAG, How to do it..." section of "Git Version Control Cookbook: Leverage version control to transform your development workflow and boost productivity, 2nd Edition"; by Aske Olsson, Rasmus Voss, Emanuele Zattin, Kenneth Geisshirt; publisher: Packt Publishing).
When sending emails to my boss, sometimes I needed to refer to the most recent commits or to a list of specific commits. I used to rely solely on git log -3
for example to display the last three commits. Unfortunately, that approach was verbose (each commit included multiple lines) and did not show the branch(es) that those commits belonged to. I started to use git log --decorate --graph --oneline --all
, which allows me to show the branch(es) that each commit belongs to. Something I also like about this new approach is that each commit is summarized using a single line:
C:\Users\jaimemontoya\[path]\app>git log --decorate --graph --oneline --all
* 99d200c (HEAD -> improvedatesformat, origin/improvedatesformat) Subtract 4 hours to the date and time stored in the database because the database uses GMT but El Salvador and Guatemala use GMT-4.
* 244a7a9 Use date() and strtotime() to format date/time in an easy to read format without the verbose and inefficient approach of multiple switch case statements.
* 4d38145 Change date format to 5 June 2020 instead of 06/05/2020 to avoid ambiguity.
* 501d4e4 (markP/subscriptions, marksubscriptions) Change CAPTCHA to reCAPTCHA for contact us form.
* fc860b2 Add ability to send country-wide bulk emails using a template other than Default Template.
* 7f9d2e7 (origin/addsubscriptiontemplates, subscriptionbanneradministration, addsubscriptiontemplates) Remove code that supported template pictures uploaded to media directory, since that implementation was abandoned.
* f6ea277 Add models/subscription_template.php, the version that no longer contains the code that associates pictures to subscription templates.
* 4373e7a Merge branch 'marksubscriptions' into addsubscriptiontemplates
See it formatted with colors:
tr '\n' ' '
to replace line-brakes with single spaces. Thanks! – Reciprocate