I have a Git repository of a corporate application that is just over 11 years in development. The size of the repository is about 4.3GB. In the project there is a file named "X" on which I am working. How could I use Git to check the changes that have been made to the file in all these years?
As additional information:
- The size of the repository is quite large.
- The file has been renamed one or more times during this time.
- The file I'm interested in has moved in the repository.
- The IDE that I use for the development and maintenance of the application is based on Eclipse (Spring Tool Suite) and it has a built-in Git option that allows me to see the commits that modified a file, but it only allows me to see from a moment that I know which is not the build one (a commit where the file was actually renamed, without telling me the old name).
If with Git it is not possible, but there is an application that allows me to do this, that would also help.
To get the change history of a specific file there is the option
--follow
ofgit log
--
beforenombreArchivo
are used to explicitly indicate that itnombreArchivo
corresponds to a file (and not, for example, to the name of a branch).If you want this information to be delivered to you in patch format , then you must execute:
You can consult the documentation of the command
log
in English (I did not find it in Spanish):Git - git-log Documentation
I looked in the Spanish translation of the GIT book , and didn't find the option either
--follow
.To complement Nicolás's answer, if you want to see which line each commit modified, you can also use
git blame [opciones] -- archivo
(original documentation in English).