Git Checkout 在 Jenkins 稀疏结帐后不起作用



我通过 Jenkins 做了稀疏的结账。我可以看到我指定的模块是结帐。现在我想从远程签出其他一些文件,这不是 jenkins 使用以下命令提前签出的文件:

git checkout dbo.tmp_ptr1307_exclude_client_ToBePurged.sql 这给了我错误 "与 Git 已知的任何文件都不匹配"

我也尝试传递sh键,例如:它检出 be4055c069ce9b9abd3baf727cfc65319f6c1dd0 dbo.tmp_ptr1307_exclude_client_ToBePurged.sql给我同样的错误。

如果要

忽略稀疏签出配置,请使用 --ignore-skip-worktree-bits 标志,如下所示:

git checkout --ignore-skip-worktree-bits -- dbo.tmp_ptr1307_exclude_client_ToBePurged.sql

在稀疏签出模式下,git checkout -- <paths>只会更新与 $GIT_DIR/info/sparse-checkout 中的<paths>和稀疏模式匹配的条目。此选项忽略稀疏模式,并重新添加 <paths> 中的任何文件。

https://git-scm.com/docs/git-checkout#git-checkout---ignore-skip-worktree-bits

最新更新