Skip to main content

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 only. 

git show <commit-id>

Shows detailed information about a specific commit, including the commit message, author, date, and changes made in the commit.


cat <file name>

“cat” is not a git command. It is a basic Unix/Linux command used to concatenate and display the contents of one or more files in the terminal.



These are basic options, and there are many more options and configurations available with the git log command.

I trust that this information has been useful for you. Appreciate you taking the time to read the blog.

Comments

Popular posts from this blog

Why do we need IP Address when the MAC address is unique? Can't we communicate with only MAC address?

IP addresses (network addresses) are used for just transferring information from one network to other, travelling of information among networks via.  IP address. Mac addresses (physical addresses) are actually used for distribution of information. 1) Carrying of information from one network to another. 2) Distribution of information (resources) is based upon Mac address.

Set focus to a control from code behind, ASP.NET!

I tried to focus on error message in a control (asp.net table)  but I couldn't get it. So I added a hyperlink control next to the table and set focus on it. It worked perfectly. What I did: Add the following code in aspx.      <asp:HyperLink ID="LnkFocus" runat="server">      </asp:HyperLink> Add this in code behind      LnkFocus.Focus(); That's all. I think this is one of the easiest way to set focus on a control.

Add meta tags in blog, blogger

Meta tags are important block of codes in the HTML of your blog or website. They tell search engines about your blog/website title, description and etc. So when users search the web for materials that are relevant to your blog/website, search engines suggest them your blog/website. Steps to add meta tags: Login to your Blogger Account Click on the Template Tab Click on Edit HTML Search for <head> Copy the following Code and Paste it Below  <head> < !-- Meta Tags - ddtechone.blogspot.com  -- >   < meta content='Your Blog Description' name='description'/ >   < meta content='Keyword1,Keyword2,...' name='keywords'/ >   < meta content='Author Name' name='Author'/ >   < meta content='all' name='robots'/ >   < meta content='Language Name' name='language'/ >   < meta content='Country Name' name='country'/ > < !-- /Meta Tags - ...