1

We work in some files that are placed in network share, more than one person can modify the same file, but when trying to push updates to github, we get error:

fatal: unsafe repository ('XXXX' is owned by someone else)

I have tried to update configuration of repo and mark it as safe directory but not working also

git config --global --add safe.directory d:\reponame

enter image description here

Ahm Sf
  • 33
  • 9
  • Why doesn't everyone just clone the git repo locally? That's the standard thing to do. If it's because the repo itself is to big, Google for "git virtual file system". – selbie Aug 15 '22 at 05:55
  • @selbie, the files in shared network are used by a production application. if everyone has it's own repo then application will not be able to read modifications to have been done to files. what do think on this case ? – Ahm Sf Aug 15 '22 at 06:55
  • 2
    @AhmSf , Then do like this : `1. Have local clone in dev machines` as @selbie mentioned. `2. Push the changes to a branch and do merge to master as a git admin` Use a single branch (say master). `3. clone same repo with branch master to the common location`. and `4. Just keep fetch and reset to master` Do not try to push from common location. – smilyface Aug 15 '22 at 08:17
  • Here's a well defined answer https://stackoverflow.com/a/71850261/2086966 – smilyface Aug 15 '22 at 10:57

0 Answers0