Home Development Tools git How to view modification history in git

How to view modification history in git

Jan 07, 2022 am 10:36 AM
git

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

How to view modification history in git

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/
Copy after login

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 文件名
Copy after login

The example is as follows:

How to view modification history in git

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
Copy after login

The results are as follows:

How to view modification history in git

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!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot Article Tags

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

What should I do if the real-time subtitle translation in Potplayer does not work when I select Google? What should I do if the real-time subtitle translation in Potplayer does not work when I select Google? May 09, 2024 pm 06:49 PM

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

How to install deepseek How to install deepseek Feb 19, 2025 pm 05:48 PM

How to install deepseek

Summary of FAQs for DeepSeek usage Summary of FAQs for DeepSeek usage Feb 19, 2025 pm 03:45 PM

Summary of FAQs for DeepSeek usage

How to register for LBank Exchange? How to register for LBank Exchange? Aug 21, 2024 pm 02:20 PM

How to register for LBank Exchange?

What are the AI ​​tools? What are the AI ​​tools? Nov 29, 2024 am 11:11 AM

What are the AI ​​tools?

PHP Git practice: How to use Git to improve code quality and team efficiency? PHP Git practice: How to use Git to improve code quality and team efficiency? Jun 03, 2024 pm 12:43 PM

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? How much margin is needed for Huobi futures contracts to avoid liquidation? Jul 02, 2024 am 11:17 AM

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? As top market makers enter the crypto market, what impact will Castle Securities have on the industry? Mar 04, 2025 pm 08:03 PM

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

See all articles