View the change history of a file using Git versioning

后端 未结 24 1992
臣服心动
臣服心动 2020-11-22 16:40

How can I view the change history of an individual file in Git, complete details with what has changed?

I have got as far as:

git log -- [filename]
         


        
24条回答
  •  孤城傲影
    2020-11-22 17:34

    You can also try this which lists the commits that has changed a specific part of a file (Implemented in Git 1.8.4).

    Result returned would be the list of commits that modified this particular part. Command :

    git log --pretty=short -u -L ,:
    

    where upperLimit is the start_line_number and lowerLimit is the ending_line_number of the file.

    More details at https://www.techpurohit.com/list-some-useful-git-commands

提交回复
热议问题