Search code examples
gitgit-squash

Squash merge and deleted image files


I have a feature branch in which I mistakenly committed a large image file, but then later deleted the file within the same feature branch. The branch was pushed up before the deletion (I don't think that matters). If I squash merge this branch into the main branch and delete the feature branch on merge, will the image file that was once in the feature branch but is no longer in either still contribute to bloat in the repository by way of its history?


Solution

  • For a while, yes, but only until the garbage collection kicks in. The file is not part of any reachable commit so it will be deleted.