Git tips: git blame && git show to see the revision history of a line of code

Source: Internet
Author: User

First, see who wrote the line of code, and in which commit:

git blame file_namegit blame-l 58,100 Keyboardactivity.java

Its display format is:

Commit ID | Code Submission Author | Submission Time | Number of lines in the file that the code is in | Actual code

This is similar to the following:

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M02/8C/24/wKioL1hjeVeyc1XSAAIDgRtPpIE882.png "style=" width : 600px;height:476px; "title=" Qq20161228163503.png "width=" "height=" 476 "border=" 0 "hspace=" 0 "vspace=" 0 "alt=" Wkiol1hjeveyc1xsaaidgrtppie882.png "/>

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M00/8C/27/wKiom1hjeVjgkQEtAAG4aBbOlj8056.png "style=" width : 600px;height:305px; "title=" Qq20161228163402.png "width=" "height=" 305 "border=" 0 "hspace=" 0 "vspace=" 0 "alt=" Wkiom1hjevjgkqetaag4abbolj8056.png "/>

So we can know the commit ID and then use the command: Git show Commitid to see ~


This article is from the "Liangxiao Technology Center" blog, please be sure to keep this source http://liangxiao.blog.51cto.com/3626612/1886961

Git tips: git blame && git show to see the revision history of a line of code

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.