Skip to main content

Posts

Showing posts from February, 2023

Important Git commands to view logs

Here are some common and important Git commands for viewing logs: git log Show the commit history for the current branch. Press Q to return git log -n Show the last n commits. git log --oneline Show the commit history in a single line format. git log --decorate Shows the commit history with reference labels such as branches and tags that point to specific commits. git log --graph Show the commit history in a graphical format. Combination of different options: git log --decorate --oneline --graph Alias can be created for long query. git config --global alias.logDetail "log --decorate --oneline --graph" git logDetail   git log -p or git log --patch Show the commit history with changes made in each commit (Show changes lines). git log -1 --stat Show the commit history with statistics about changes (Show committed files) and 1 displays latest one commit onl