我正在創建我的點文件並使用哦我的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