How can I see the change history for a file in Git, along with the changes in each commit?
I have used:
git log -- [filename]
which shows me the history of commits on the file, but not the content of each change per commit.
How can I see the change history for a file in Git, along with the changes in each commit?
I have used:
git log -- [filename]
which shows me the history of commits on the file, but not the content of each change per commit.
According to the official git-log(
man git-log
) documentation you can make use of 2 useful arguments:graphic mode
(author: @Tim Cooper )
You can use the command:
There is information in this question similar to yours: View the change history of a file using Git versioning - StackOverflow .
What I do to perform this task is the following:
When I prepare my files to upload them to the
HEAD
, I usegit commit -m "algún mensaje" -v
what it does-v
causes the differences of your changes to be added.After uploading them, I use the following command
git log -c
, which shows you all the onescommits
from the last to the firstcommit
, made to the file with their respective changes, as well as some additional data, such as theindex
,inserciones
and others.It is done with the command:
gitk documentation