DEV Community

muTheTechie
muTheTechie

Posted on

[FIXED] fatal: this operation must be run in a work tree

This error may happened due to the mis-configuration of the git as bare. So, the following command will remove/unset the bare setup

git config --unset core.bare
Enter fullscreen mode Exit fullscreen mode

Discussion (2)

Collapse
ngdangtu profile image
Đăng Tú • Edited on

In my case, I was mistakenly to execute git commands in .git dir. The solution was pretty embarrassing silly :)) . Just cd out of it and execute the command again :))

Collapse
ayushaustin profile image
AYUSH RAJ

its not working for window 10 (11.06.2020)