繁体   English   中英

在工作树中从git取消跟踪文件

[英]Untrack files from git in worktree

我有三台机器,本地->服务器A->服务器B
并在本地编程,然后使用git push本地代码到服务器A,
在服务器AI上设置钩子以将代码推送到服务器B,
服务器A和服务器B上的服务器均已配置

$ git config core.worktree /home/www
$ git config core.bare false
$ git config receive.denycurrentbranch ignore

并有一个钩子git checkout -f

如何更改服务器B上的某些文件而不进行跟踪?

我尝试git update-index --assume-unchanged path/to/file
但始终会fatal: Unable to write new index file

我确定用户在该文件夹中具有权限(可以写入,读取和执行)
我也尝试git update-index --skip-worktree path/to/file不起作用

您的存储库中应该有一个.gitignore文件。 您可以包含不应跟踪到.gitignore的文件,请在此处阅读更多内容。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM