[英]How IntelliJ IDEA automatically detects and ignore target directory from a Git repo without even using .gitignore file?
我是第一次使用IntelliJ IDEA。 我將已經存在的項目添加到Git中,當我看到未版本化和被忽略的文件時,我看到target/
目錄已經在“ 忽略字段”列表中。 由於我什至沒有.gitignore
文件,因此如何從Git中排除target/
目錄?
更新 :是的,這是一個Maven項目
Preferences | Editor | File Types, Ignore files and folders
Preferences | Editor | File Types, Ignore files and folders
: * .hprof; *。pyc; *。pyo; *。rbc; *。yarb; *〜; .DS_Store; .git; .hg; .svn; CVS; __ pycache __; _ svn; vssver .scc; vssver2.scc;
.git/info/exclude
:
#git ls-files --others --exclude-from = .git / info / exclude
#以'#'開頭的行是注釋。
#對於大多數使用C語言編寫的項目,以下內容將是不錯的選擇
#排除模式(如果要使用它們,請取消注釋):
#*。[oa]
\\#*〜
git config --global core.excludesfile
指向“ some-path / some-path / .gitignore_global”,里面的內容是: Preferences | Editor | File Types, Ignore files and folders
Preferences | Editor | File Types, Ignore files and folders
允許全局忽略文件/文件夾。
還要檢查您的git config --global core.excludesfile
設置,該設置可以更新。
並且,如前所述,您的項目.git/info/exclude
文件。
請注意,例如,默認的JetBrains .gitignore
不會忽略嵌套文件夾中的.idea/workspace.xml
文件。 (請參閱問題IDEA-90785 )
workspace.xml
用於存儲用戶特定的(非共享的)運行配置。
因此,我在挖掘一些IDEA博客,然后發現了這一點 。 IDEA創建了一個workspace.xml
文件,其中包含被忽略的路徑,這是其中的一項
<ignored path="$PROJECT_DIR$/my-website-REST/target/" />
我相信這是IDEA忽略版本控制文件的地方。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.