Asroads'Blog 君子不器
LFS遇到“brew link git-lfs” 失败解决
发布于: 2018-07-12 更新于: 2024-03-02 分类于: tool 阅读次数: 

现象描述

1
2
3
4
5
6
7
Warning: git-lfs 2.5.1 is already installed, it's just not linked
You can use `brew link git-lfs` to link this version.
localhost:~ jsroads$ brew link git-lfs
Linking /usr/local/Cellar/git-lfs/2.5.1...
Error: Could not symlink share/man/man5/git-lfs-config.5
/usr/local/share/man/man5 is not writable.
localhost:~ jsroads$

解决办法

This is probably an error related to permissions.

Try

1
sudo chown -R $(whoami) /usr/local/share/

or, if you only need this on the git-core path

1
sudo chown -R $(whoami) /usr/local/share/git-core 

might be enough.

Then run

1
brew link git

again.

最后 问题解决

1
2
3
4
5
6
7
8
localhost:~ jsroads$ sudo chown -R $(whoami) /usr/local/share/
Password:
Sorry, try again.
Password:
localhost:~ jsroads$ brew link git-lfs
Linking /usr/local/Cellar/git-lfs/2.5.1... 32 symlinks created
localhost:~ jsroads$

--- 本文结束 The End ---