Home > Article > Development Tools > How to view commit modifications in git
How to view commit modifications in git: 1. Use "git log" to print all commit records and obtain the commitid of the commit that needs to be viewed; 2. Use the "git show commitIdfile" command to view the modifications; 3. Use " "git show commitId fileName" to view the modifications of a specific file in a commit.
The operating environment of this article: Windows 10 system, Git version 2.30.0, Dell G3 computer.
Specific steps:
1. First, you need to print all commit records through git log
Find the one you want to view The commitid of the commit.
2. Check the changes.
git show commitIdfile
3. Check the modification of a specific file in a commit:
git show commitId fileName
Expand knowledge:
Sometimes we find that the code that was originally online has been modified, or our own code has been overwritten. We need to know who did the operation and what modifications were made. This article will introduce how git views the submission record and the modification content of a certain submission
win logo key R, enter cmd to open the command line. (If git cannot be used on the cmd command line, please open Git Bash)
Enter the project root directory
Enter git log and press Enter
Each submission is output in the command line Record
Recommended study: "Git Tutorial"
The above is the detailed content of How to view commit modifications in git. For more information, please follow other related articles on the PHP Chinese website!