How to view modification history in git
Jan 07, 2022 am 10:36 AMHow to view the modification history in git: 1. Use the "git log --pretty=oneline file name" command to view the modification history of the specified file; 2. Use "git show commit hash value" to view all modifications of the commit Content.
The operating environment of this article: Windows 10 system, Git version 2.30.0, Dell G3 computer.
How to check the modification history in git
Sometimes when comparing codes, you see certain changes, but you don’t know the author of the changes and the reason, and I don’t know the corresponding BUG number, which means that the specific reasons for these changes cannot be found~
[Note]: A certain file can be changed a limited number of times, and each time the code is modified Submissions will have a commit description, we can start from here;
1. Switch to the directory
First switch to the directory where the file you want to view is located:
cd packages/apps/Mms/src/com/android/mms/ui/
2. git log --pretty
Then use the following command to list all the change history of the file. Note that this focuses on a specific file, not the git library. If it is a library, there will be many changes. ~
git log --pretty=oneline 文件名
The example is as follows:
3. git show
As shown above, what is printed is for the file MessageItem.java For all the change history, the long string of numbers at the front of each line is the hash value formed by each submission. Then use git show to display the specific changes of a certain change~
git show 356f6def9d3fb7f3b9032ff5aa4b9110d4cca87e
The results are as follows:
Recommended learning: "Git Tutorial"
The above is the detailed content of How to view modification history in git. For more information, please follow other related articles on the PHP Chinese website!

Hot Article

Hot tools Tags

Hot Article

Hot Article Tags

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

What should I do if the real-time subtitle translation in Potplayer does not work when I select Google?

PHP Git practice: How to use Git to improve code quality and team efficiency?

How much margin is needed for Huobi futures contracts to avoid liquidation?

As top market makers enter the crypto market, what impact will Castle Securities have on the industry?
