简体   繁体   English

git branch和git log仅适用于sudo

[英]git branch and git log only work with sudo

I'm having an issue where git branch and git log give no output unless I use them with sudo . 我有一个问题,除非我将它们与sudo一起使用,否则git branchgit log提供任何输出。 Here is a screenshot showing the issue. 这是显示问题的屏幕截图。

I'm on linux mint 19 with ecryptfs. 我在使用Ecryptfs的Linux Mint 19上。 I've tried two different terminal emulators and the problem persists. 我尝试了两种不同的终端模拟器,问题仍然存在。 If there's any more information that you think would be helpful, please let me know. 如果您认为还有其他信息会有所帮助,请告诉我。

Screenshot 屏幕截图

I would say your .git Directory is not readable by the current user. 我想说您的.git目录当前用户不可读。 Run a ls -la .git and see what the permissions and owner for the directory . 运行ls -la .git并查看ls -la .git的权限和所有者. show. 节目。

Then you need to decide if you want to give your user permissions or ownership for the .git directory (and probably also the project files themselves) 然后,您需要确定是否要授予用户对.git目录的权限或所有权(可能还有项目文件本身)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM