Git failded with fatal error. fata: detected ownership in repository at <path> in git

Prem Murmu on 2/19/2023 3:48:44 PM

Git failded with fatal error. fata: detected ownership in repository at 'c:/workdirectory/ projects/repos/edemo' 'C:/workdirectory/ projects/repos/edemo' is owned by: 's-1-5-21-2021243588-4293919169-3387299209-8806270' but the current user is: 's-1-5-21-4255815394-2214699486-701957579-500'

To add add an exception for this directory, call:

git config --global --add safe.directory c:/workdirectory/ projects/repos/edemo


Solutions:

For windows use below command:

takeown /f <project path> /r /d y

Like:  takeown /f  "C:/workdirectory/projects/repos/edemo"  /r /d y

For Linux use below command:

chown -R username:group <path to the repository>

Next make or add the directory to the safe directory list by below git command:

git config --global --add safe.directory <project path>

 Like:- git config --global --add safe.directory c:/workdirectory/ projects/repos/edemo


0 Comments on this post

Comments(0)||Login to Comments


InterServer Web Hosting and VPS
  • see more..