“Git error: could not lock config file C:/Users/old_profile/.gitconfig: No such file or directory” after profile migration

后端 未结 5 2035
日久生厌
日久生厌 2020-12-15 11:21

I have an interesting error that keeps coming up when using git for windows (version 2.12.0.windows.1). I recently migrated my windows profile directory from one location to

5条回答
  •  北荒
    北荒 (楼主)
    2020-12-15 12:21

    In WSL / bash

    Use sudo to set values. This should only apply to the --system scope.

    sudo git config --system diff.tool p4merge
    

    In Cmd / PowerShell

    Run as Administrator to set values. This is because the gitconfig file (probably located at: C:\Program Files\Git\mingw64\etc\) is protected.

    Only SYSTEM and COMPUTER\Administrators have Modify rights. The rest of the ACLs have Read and Read & execute rights only.

提交回复
热议问题