git 报错:insufficient permission for ... ... 解决方案

~/Documents/Lea/blog(master*) » git add .
error: insufficient permission for adding an object to repository database .git/objects
error: source/_posts/React梳理.md: failed to insert into database
error: unable to index file source/_posts/React梳理.md
fatal: updating files failed

解决方案:

sudo chown -R 用户名 仓库路径

# sudo chown -R zzy /Users/zzy/Documents/Lea/blog
git
71 views
Comments
登录后评论
Sign In