DEV Community

Muthu
Muthu

Posted on

7 2

[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

Top comments (2)

Collapse
 
ngdangtu profile image
Đăng Tú • Edited

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)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay