我正在按照此命令对git存储库中的所有提交执行更漂亮的操作:
git filter-branch --tree-filter 'prettier --write "**/**.js" || echo “Error formatting, possibly invalid JS“' -- --all
我想在git filter repo中执行相同的操作,但是我什至不确定是否可以实现。谁能帮忙使用git filter repo来解决这个问题?
我想在git过滤器仓库中执行相同的操作,但是我什至不确定是否可以实现
是,它是一个blob callback,允许您在所需的Blob上调用所需的任何脚本/命令,类似于在newren/git-filter-repo issue 45和this example中进行的操作>
git filter-repo --force --blob-callback '
import black
blob.data = black.reformat_commit(blob.data.decode(), mode=black.FileMode()).encode()
'