在Mac OS的哪里可以找到git的.config目录? [英] where to find the .config directory of git on mac os?

查看:114
本文介绍了在Mac OS的哪里可以找到git的.config目录?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这个问题,我需要在git上恢复默认权限,因为当我执行flutter Doctor时会收到错误

I have this problem which is I need to restore the default permission on my git because when I'm executing the flutter doctor I get an error

fee@Mac-mini ~ % flutter doctor -v
warning: unable to access '.git/config': Permission denied
fatal: unable to access '.git/config': Permission denied
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

Returning 1970-01-01 08:00:00.000 instead.
[✓] Flutter (Channel unknown, 0.0.0-unknown, on Mac OS X 10.15.3 
19D76, 
locale
    en-US)
    • Flutter version 0.0.0-unknown at /Users/fee/Documents/flutter
    • Framework revision  (), 1970-01-01 08:00:00.000
    • Engine revision b59e3e9c39
    • Dart version 2.9.0 (build 2.9.0-8.0.dev 2bf3259005)


[✓] Android toolchain - develop for Android devices (Android SDK.    
version 28.0.3)
    • Android SDK at /Users/fee/Library/Android/sdk
    • Platform android-29, build-tools 28.0.3
    • Java binary at: /Applications/Android
      Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build
      1.8.0_202-release-1483-b49-5587405)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 11.4.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 11.4.1, Build version 11E503a
    • CocoaPods version 1.8.4

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google 
 Chrome

[✓] Android Studio (version 3.5)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 44.0.1
    • Dart plugin version 191.8593
    • Java version OpenJDK Runtime Environment (build
      1.8.0_202-release-1483-b49-5587405)

[✓] Connected device (2 available)
    • Web Server • web-server • web-javascript • Flutter Tools
    • Chrome     • chrome     • web-javascript • Google Chrome 
81.0.4044.138

    • No issues found!
fee@Mac-mini ~ % 

我有一个好朋友,可以帮助我

I have a good friend who helps me in here he said that if my run sudo chown -R .config in .git directory it restores the default permission

但是当我在终端中找到我的.git文件夹时,它说权限被拒绝,这就是为什么我无法在.git文件夹中运行代码来恢复我的用户权限

but when i locate my .git folder in terminal it says permission denied that's why i cant run the code in .git folder to restore my user permission

fee@Mac-mini git % /Users/fee/.git         
zsh: permission denied: /Users/fee/.git

帮助我了解如何访问包含.config的.git文件夹以恢复我的权限,或如何使用git config恢复默认用户权限

help me on how to access this .git folder that contains the .config to restore my permission or how to restore the default user permission using git config

推荐答案

将内容复制到文件中并粘贴为新文件.

Copy the contents to a file and paste in as new file.

我的意思是使用文本编辑器打开 .git/config ,在其中复制内容,然后粘贴到临时文件中.现在删除罪魁祸首配置文件并将新的配置文件复制到 .git 文件夹

By that I mean open .git/config with a text editor, copy the stuff in there, then paste to a temporary file. Now delete the culprit config file and copy new config file to the .git folder

这篇关于在Mac OS的哪里可以找到git的.config目录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆