我正在创建我的点文件并使用哦我的zsh。它会在我的主目录中创建一个名为.oh-my-zsh的目录。忽略子目录的.gitignore
我想忽略.oh-my-zsh里面的所有内容,除了custom /目录。但是,custom /具有example.zsh文件和一个名为example /的目录,其中包含example.plugin.zsh文件,我也想忽略它们。
使其更清晰,结构可以被认为是这样的:
.oh-my-zsh/
custom/
my-folder-to-be-kept/
..
example/
example.plugin.zsh
example.zsh
lib/
log/
...
我在我的主目录中的.gitignore:
/.oh-my-zsh/*
!/.oh-my-zsh/custom/
/.oh-my-zsh/custom/example.zsh
/.oh-my-zsh/custom/example/example.plugin.zsh
然而,里面有一个的.gitignore文件。 oh-my-zsh,其中包含以下内容:
locals.zsh
log/.zsh_history
projects.zsh
custom/*
!custom/example
!custom/example.zsh
*.swp
!custom/example.zshcache
cache/
当我添加未跟踪文件时,example.p lugin.zsh被忽略,但example.zsh不是。因此,我想我必须忽略.oh-my-zsh中的.gitignore,这样我的.gitignore才能工作,因为!custom/example.zsh
是冲突的。
问题是我不能。我必须遵循这个,因为这是哦我的zsh所需的结构。这个.gitignore是在安装时生成的,不是由我创建的,也不是通过某种配置进行定制的。 –
我认为没有办法做到这一点。你应该找到一个解决它的方法来改变其他.gitignore的创建方式 – iberbeu