how to allow the access of git/config in mac os?

1,971

The .config folder is supposed to be owned by the user. It appears that the ownership got changed to system by mistake on your machine.

With following command, you can restore the default permission on your MacOS:

sudo chown -R <username> .config

(Substitute <username> with your username. You can find your username as follows: whoami)

When prompted for a password, enter your login password.

Share:
1,971
Ken Verganio
Author by

Ken Verganio

Updated on December 20, 2022

Comments

  • Ken Verganio
    Ken Verganio over 1 year

    I having this problem because when I run flutter doctor it says . btw I'm using mac os

    Failed to find the latest git commit date: VersionCheckError: Command exited
    with code 128: git -c log.showSignature=false log -n 1 --pretty=format:%ad
    --date=iso
    Standard out: 
    Standard error: warning: unable to access '.git/config': Permission denied
    fatal: unable to access '.git/config': Permission denied
    

    I ask this question in this link but one person said that I should check the user and I see that I'm the user registered there. I think I need to go to git folder and allow permission in properties but I don't know to get into git folder in mac os

    • Rakmo
      Rakmo almost 4 years
      sudo . This is God level option.
  • Ken Verganio
    Ken Verganio almost 4 years
    I did what you said but it still displays the same error and is it ok if my username in whoami is different in the git config --global -l username that I use. I run your code and input password and after that, I run flutter doctor but it displays the same error
  • Ken Verganio
    Ken Verganio almost 4 years
    no it says no such file or directory when I use cd .git
  • Ken Verganio
    Ken Verganio almost 4 years
    i cant cd in usr/bin/git
  • SwissCodeMen
    SwissCodeMen almost 4 years
    and if you don't access the .git folder, you must enter the same command above in the answer for the .git folder and not for the config folder (I misunderstand your question)
  • Ken Verganio
    Ken Verganio almost 4 years
  • Ken Verganio
    Ken Verganio almost 4 years
    when i cd the usr/bin/git it says no such file or directory
  • Ken Verganio
    Ken Verganio almost 4 years
    i found where my git folder is and when I run your code sudo chown -R <mysusername> .config it says no such file or directory and when I run the ls -la I don't see my username and also I don't see any .config file in my git folder
  • Ken Verganio
    Ken Verganio almost 4 years
    its in usr/local/git and when I run git init it says permission denied
  • Ken Verganio
    Ken Verganio almost 4 years
    I locate my .git folder but it says "zsh: permission denied: /Users/me/.git" thats why i can't run your ocde
  • Ken Verganio
    Ken Verganio almost 4 years
    but how do i access this .git folder
  • Ken Verganio
    Ken Verganio almost 4 years
    also the .git folder has zero bytes when i locate and open it it's empty
  • Ken Verganio
    Ken Verganio almost 4 years
    i ask another question in here stackoverflow.com/questions/61830920/…
  • Ken Verganio
    Ken Verganio almost 4 years
    i solved the problem by running sudo chown -R <username> .config or .git in flutter folder