-1

What happens with the file in git log after you remove the file from index and git directory using git rm ? I tried to remove a file using git rm and then searched for it in git log and it still gave me all the commits for this specific file.

Answer:

Like @mkrieger1 said the file is with git rm removed from the repository but all the history regarding this removed file is still in the git log. Of course there is a possibility of rewriting history like @evolutionxbox suggested. Thanks to both :)

Ana Sustic
  • 425
  • 2
  • 17
  • 3
    As you have seen, nothing happens to the file in `git log` when you use `git rm`. It doesn't change the existing commits. – mkrieger1 Apr 06 '21 at 19:10
  • Does this answer your question? [How to remove file from Git history?](https://stackoverflow.com/questions/43762338/how-to-remove-file-from-git-history) – evolutionxbox Apr 06 '21 at 19:44

1 Answers1

0

Like @mkrieger1 said the file is with git rm removed from the repository but all the history regarding this removed file is still in the git log. Of course there is a possibility of rewriting history like @evolutionxbox suggested. Thanks to both :)

Ana Sustic
  • 425
  • 2
  • 17