How to find out file modification records, known codes and file names in git
PHP中文网
PHP中文网 2017-05-02 09:49:04
0
4
591

A line of code in a file was modified to an incorrect code. How can I use the git command to find out who modified the code?
git blame filepath Since there are too many file modification records and all are displayed, how can we find the culprit more accurately and quickly

PHP中文网
PHP中文网

认证高级PHP讲师

reply all(4)
黄舟

git blame filepath | grep 'code'
or
git blame filepath | grep 'lineNO)'

世界只因有你

You can use the sourcetree tool. In this tool, the operations are all interface-based, and it is more convenient to search for records.

左手右手慢动作

The fastest one is probably blame. Just find that line and see who wrote the commit

You can also git log -p -M --follow --stat -- 文件名 and search

阿神

vim file.name Enter the file, move the cursor to this line, and then ":Gblame", the record of who modified this line will be displayed on the left.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template