我最近发现我的.gitconfig
附加了几行:
[filter "hawser"]
clean = git hawser clean %f
smudge = git hawser smudge %f
required = true
Run Code Online (Sandbox Code Playgroud)
由于它是版本控制的,我相信我没有添加它们.看来我不是 在 唯一有这些线路之一.
但是:git: 'hawser' is not a git command
.git help
不提供任何其他信息.
那么,这个"大索"过滤器是什么?
Cam*_*rzt 31
我发现我的更改.gitconfig
恰好与mac的github更新完全一致,这就是为什么我在我的repo中将其标记为这样.
至于Hawser实际上是什么,Github for mac将它捆绑在/Applications/GitHub.app/Contents/Resources/hawser/bin/git-hawser
路径上.
使用--help=false
yield 运行可执行文件:
git-hawser/0.4.0 (GitHub; darwin amd64; git 2.3.0; go 1.3)
Usage:
git-hawser [flags]
git-hawser [command]
Available Commands:
add Add an entry to .gitattributes
clean Implements the Git clean filter
env Show the current environment
init Initialize the default Git Media configuration
logs View error logs
ls-files Show information about hawser files
path Manipulate .gitattributes
push Push files to the hawser endpoint
rm Remove an entry from .gitattributes
remove Remove an entry from .gitattributes
smudge Implements the Git smudge filter
status Show information about hawser files that would be pushed
update Update local hawser configuration
version Show the version number
help [command] Help about any command
Available Flags:
--help=false: help for git-hawser
Use "git-hawser help [command]" for more information about that command.
Run Code Online (Sandbox Code Playgroud)
strings
在GitHub.app中运行一些可执行文件会打开字符串git-media | hawser,除了用法消息之外,还强烈地指示git-hawser是用于存储git repo之外的大文件的git-media的分支或重新实现,因为github有100MB的硬文件大小限制.我现在正在测试,看看如果你尝试通过GitHub.app上传一个巨大的文件会发生什么.
事实证明,GitHub.app在处理大型文件时不会自动使用git-hawser,但会strings
发现它确实具有与git-hawser进程交互的能力.
安装命令行工具安装github
工具git-hawser
来/usr/local/bin
.跑步git-hawser version -c
给出:
git-hawser/0.4.0 (GitHub; darwin amd64; git 2.3.3; go 1.3)
Nothing may see Gah Lak Tus and survive!
Run Code Online (Sandbox Code Playgroud)
这看起来很相关:https://github.com/blog/1986-announcing-git-large-file-storage-lfs
并且lo,hawser过滤器被复制为lfs(大文件支持):
[filter "lfs"]
clean = git lfs clean %f
smudge = git lfs smudge %f
required = true
Run Code Online (Sandbox Code Playgroud)
hawser是Git LFS的旧名称(git-media是更老的名字),所以我相信可以放弃.
谷歌搜索这真的很难,但我终于发现提交将项目从hawser重命名为lfs(https://github.com/github/git-lfs/commit/e37b69547710e2a341bc7904d291029ac594b3be),另一个提到旧git-media
名称(https:// github.com/github/git-lfs/commit/eac36d7f04074882a7e3c9ad2cfc1d4f4a7b08fd).
因此,在〜/ .gitconfig中的这些块中,删除"media"和"hawser"块应该是安全的,尤其是在安装git-lfs之后.换句话说,从这个配置块:
[filter "media"]
required = true
clean = git media clean %f
smudge = git media smudge %f
[filter "hawser"]
clean = git hawser clean %f
smudge = git hawser smudge %f
required = true
[filter "lfs"]
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
required = true
Run Code Online (Sandbox Code Playgroud)
你可以去
[filter "lfs"]
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
required = true
Run Code Online (Sandbox Code Playgroud)