我的回购https://example.com/repo.git
需要一个涂抹和清洁过滤器。我尝试以下设置。
$ git init --bare
$ git config filter.example.required true
$ git config filter.example.smudge "/path/to/smudge-filter.sh %f"
$ git config filter.example.clean "/path/to/clean-filter.sh %f"
$ git remote add master https://example.com/repo.git
$ git pull
fatal: This operation must be run in a work tree
或者反过来呢?克隆回购并在效果后应用过滤器?
答案 0 :(得分:1)
正确的方法是克隆但稍后结帐:
$ git clone --no-checkout https://example.com/repo.git
$ git config filter.example.required true
$ git config filter.example.smudge "/path/to/smudge-filter.sh %f"
$ git config filter.example.clean "/path/to/clean-filter.sh %f"
$ git checkout --