The .gitignore setting for the .idea folder of Jetbrains Rider's does not work
Asked Answered
D

2

9

I am currently working on a game project for Android using Unity and Rider on Windows10. Git administration is using Github Desktop.

After completing the game production, I tried to set up .gitignore to upload to Github, I connected to gitignore.io and selected windows, unity, jetbrains + all, and then entered .gitignore in my .gitignore which is displayed on the screen. The link to the code is https://www.gitignore.io/api/unity,windows,jetbrains+all.

The code below is the .gitignore code I wrote down.

# 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

However, some of the files in the .idea folder are different from the .gitignore settings. So I left this question. As far as I know, the subdirectory of the .idea folder should not be registered with git, but I wonder if it is normal to see some files. If this is not normal, it will ask you if you want to add all the .idea folder sub-lists to .gitignore.

The picture below is a picture taken from Github Desktop.

enter image description here

I will be waiting for a good answer. Thanks for reading.

Downstairs answered 10/11, 2018 at 7:18 Comment(1)
This question is more about which files are relevant to track than on how to use git.I would not have used the git tag.Cletis
K
14

The reason that this folder is not ignored since it stores the configuration of your project and due to that it's not part of the default .gitignore

You can fix it in no time.


Explaining how to do from the command line, can be done via IDEA as well.

# 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>
Karisa answered 10/11, 2018 at 7:30 Comment(3)
Thank you. Thanks to Responder, if the file is already in git and is tracking, I need to clear the cache. Thank you for your reply and hope you have a good day today.Downstairs
Good luck, and yes follow the script it will fix it for you. i wrote there all you will needKarisa
Not answering the questionStuartstub
T
1
echo ".idea/*" >> ~/.gitignore
git config --global core.excludesfile ~/.gitignore
Trine answered 20/3, 2019 at 12:19 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.