Deletion of file in .git folder

I have unintentionally deleted a file in the .git folder. The repository seems to still work (commit, push, pull, … are working without problems). Could a deletion of a file inside the .git folder affect the files outside this folder? could the deletion undo some changes in the repository files?


if you deleted something from the local object storage, this could have been affected. Git normally would tell you about it when running an integrity check.

git fsck --full

In case you have synced/pushed all branches already, you can move the cloned directory to a temporary location and git clone from the GitLab server again.

This is something I do when I break things with a global sed/replace magic which touches .git. Changes from the current branch might be pulled from the temporary directory when needed.


1 Like