简体   繁体   English

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

[英]Untrack files from git in worktree

I have three machine, local -> Server A -> Server B 我有三台机器,本地->服务器A->服务器B
and programming on local, then use git push local code to Server A, 并在本地编程,然后使用git push本地代码到服务器A,
on Server AI set a hook to push the code to Server B, 在服务器AI上设置钩子以将代码推送到服务器B,
both on Server A and Server B have configure this 服务器A和服务器B上的服务器均已配置

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

and have a hook git checkout -f 并有一个钩子git checkout -f

how can I change some files on Server B and not track it? 如何更改服务器B上的某些文件而不进行跟踪?

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

I'm sure user have permission in that folder(can write, read and execute) 我确定用户在该文件夹中具有权限(可以写入,读取和执行)
I also try git update-index --skip-worktree path/to/file doesn't work 我也尝试git update-index --skip-worktree path/to/file不起作用

You should have a .gitignore file in your repository. 您的存储库中应该有一个.gitignore文件。 You can include the files which should not be tracked into .gitignore , read more here . 您可以包含不应跟踪到.gitignore的文件,请在此处阅读更多内容。

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

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