首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >Jetbrains的.gitignore文件夹的.idea设置不起作用

Jetbrains的.gitignore文件夹的.idea设置不起作用
EN

Stack Overflow用户
提问于 2018-11-10 07:18:49
回答 2查看 10.5K关注 0票数 6

我目前正在为安卓开发一个游戏项目,在Windows10上使用。Git管理部门正在使用Github桌面。

在完成游戏制作之后,我尝试设置.gitignore上传到Github,我连接到gitignore.io并选择了窗口、统一、jetbrains + all,然后在屏幕上显示的.gitignore中输入了.gitignore。到代码的链接是https://www.gitignore.io/api/unity,windows,jetbrains+all

下面的代码是我写下的.gitignore代码。

代码语言:javascript
运行
复制
# Created by https://www.gitignore.io/api/unity,windows,jetbrains+all
# Edit at https://www.gitignore.io/?templates=unity,windows,jetbrains+all

### JetBrains+all ###
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839

# User-specific stuff
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/**/usage.statistics.xml
.idea/**/dictionaries
.idea/**/shelf

# Generated files
.idea/**/contentModel.xml

# Sensitive or high-churn files
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/dbnavigator.xml

# Gradle
.idea/**/gradle.xml
.idea/**/libraries

# Gradle and Maven with auto-import
# When using Gradle or Maven with auto-import, you should exclude module files,
# since they will be recreated, and may cause churn.  Uncomment if using
# auto-import.
# .idea/modules.xml
# .idea/*.iml
# .idea/modules

# CMake
cmake-build-*/

# Mongo Explorer plugin
.idea/**/mongoSettings.xml

# File-based project format
*.iws

# IntelliJ
out/

# mpeltonen/sbt-idea plugin
.idea_modules/

# JIRA plugin
atlassian-ide-plugin.xml

# Cursive Clojure plugin
.idea/replstate.xml

# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties

# Editor-based Rest Client
.idea/httpRequests

# Android studio 3.1+ serialized cache file
.idea/caches/build_file_checksums.ser

### JetBrains+all Patch ###
# Ignores the whole .idea folder and all .iml files
# See https://github.com/joeblau/gitignore.io/issues/186 and https://github.com/joeblau/gitignore.io/issues/360

.idea/

# Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-249601023

*.iml
modules.xml
.idea/misc.xml
*.ipr

### Unity ###
[Ll]ibrary/
[Tt]emp/
[Oo]bj/
[Bb]uild/
[Bb]uilds/
Assets/AssetStoreTools*

# Visual Studio cache directory
.vs/

# Autogenerated VS/MD/Consulo solution and project files
ExportedObj/
.consulo/
*.csproj
*.unityproj
*.sln
*.suo
*.tmp
*.user
*.userprefs
*.pidb
*.booproj
*.svd
*.pdb
*.opendb
*.VC.db

# Unity3D generated meta files
*.pidb.meta
*.pdb.meta

# Unity3D Generated File On Crash Reports
sysinfo.txt

# Builds
*.apk
*.unitypackage

### Windows ###
# Windows thumbnail cache files
Thumbs.db
ehthumbs.db
ehthumbs_vista.db

# Dump file
*.stackdump

# Folder config file
[Dd]esktop.ini

# Recycle Bin used on file shares
$RECYCLE.BIN/

# Windows Installer files
*.cab
*.msi
*.msix
*.msm
*.msp

# Windows shortcuts
*.lnk

# End of https://www.gitignore.io/api/unity,windows,jetbrains+all

但是,.idea文件夹中的一些文件与.gitignore设置不同。所以我留下了这个问题。据我所知,.idea文件夹的子目录不应该在git中注册,但我不知道是否正常地看到一些文件。如果这是不正常的,它将询问您是否要将所有.idea文件夹子列表添加到.gitignore。

下面的图片是一张从Github桌面拍摄的照片。

我将等待一个好的答案。感谢您的阅读。

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2018-11-10 07:30:16

此文件夹未被忽略的原因,因为它存储了项目的配置,并且由于它不是默认.gitignore的一部分

你很快就能修好它。

从命令行解释如何做,也可以通过IDEA完成。

代码语言:javascript
运行
复制
# Once the files are committed adding them to .gitignore will not help,
# you must remove them from the index
# Remove the file from the repository
git rm --cached .idea/

# now update your gitignore file to ignore this folder
echo '.idea' >> .gitignore

# add the .gitignore file to your index
git add .gitignore

git commit -m "Removed .idea files"
git push origin <branch>
票数 12
EN

Stack Overflow用户

发布于 2019-03-20 12:19:09

代码语言:javascript
运行
复制
echo ".idea/*" >> ~/.gitignore
git config --global core.excludesfile ~/.gitignore
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/53236846

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档