我需要克隆到现有的目录($HOME
,用于管理点文件)的git回购。我正在做一个裸克隆并重新配置它,因为我需要克隆到现有的不干净的工作目录。 它的工作原理,但是我发现git status
试图在第一次使用时运行过滤器。为什么要这样做,我该如何预防它?为什么'git status'运行过滤器?
试试这个:
# create a test repo
mkdir test && cd test
git init
echo hello > hello.txt
git add .
git commit -m 1
echo 'hello.txt filter=foo diff=bar' > .gitattributes
git add .
git commit -m 2
# clone it bare and configure it
mkdir ../test2 && cd ../test2
git clone --bare ../test .git
git config core.bare false
git config core.logallrefupdates true
git reset
git checkout .
git config filter.foo.clean foo
git config filter.foo.smudge foo
git config diff.bar.textconv bar
这borks
$ git status
error: cannot run foo: No such file or directory
error: cannot fork to run external filter 'foo'
error: external filter 'foo' failed
On branch master
nothing to commit, working tree clean
这不
$ git status
On branch master
nothing to commit, working tree clean
而且,最初做git status
多次快速连续(即git status; git status; git status)
可以产生多个失败,有时候,
据我所知,可以通过much reading进行确认,只有在检查输入和输出文件时,过滤器才会运行。
那么为什么git status
运行它们?
你的'git --version'是什么? –
git版本2.11.0 – starfry
顺便说一句,我不会(也不要)以这种方式管理点文件。相反,我的主目录中有一个名为'Dotfiles'的Git目录,它是一个普通的非裸树,然后将'.whatever'符号链接到''Dotfiles/whatever'。 – torek