Search code examples
gitgithubcontrolled-folder-access

Trouble setting with git


I'm getting this error when trying to set the git init:

$ git init error: could not lock config file C:/Users/khaled/Desktop/firstTemplete/.git/config: No such file or directory fatal: could not set 'core.repositoryformatversion' to '0'

anyone have any idea ?


Solution

  • In Windows, the problem could occur due to the unauthorized changes for a folder are blocked by the virus and threat protection software.

    1. Open your Windows Defender Security Center
    2. Go to Home
    3. Click and open "Virus and Threat protection"
    4. Click and open "Virus and threat Protection Setting"
    5. Click and open "Manage Controlled folder access" in "Controlled folder access"option
    6. Turn the "Controlled Folder access" OFF

    Run "Git init" from cmd. DONE!