How do I ignore PyCharm configuration files in a git repository?

后端 未结 4 1958
挽巷
挽巷 2021-01-30 10:28

I don\'t want to commit my PyCharm config files (e.g. .idea/codeStyleSettings.xml) to my git repository, so I added the following to my .gitignore file:

.idea/
m         


        
4条回答
  •  青春惊慌失措
    2021-01-30 11:04

    • Remove the .idea folder (keep a copy)
    • Commit the changes

    Add the following to the gitignore

    (JetBrains recommended exclusions for PyCharm that also covers JetBrains plugins etc):

    ### JetBrains ###
    # 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/dictionaries .idea/vcs.xml .idea/jsLibraryMappings.xml
    
    # Sensitive or high-churn files: .idea/dataSources.ids .idea/dataSources.xml .idea/dataSources.local.xml .idea/sqlDataSources.xml .idea/dynamic.xml .idea/uiDesigner.xml
    
    # Gradle: .idea/gradle.xml .idea/libraries
    
    # Mongo Explorer plugin: .idea/mongoSettings.xml
    
    ## File-based project format:
    *.iws
    
    ## Plugin-specific files:
    
    # IntelliJ /out/
    
    # mpeltonen/sbt-idea plugin .idea_modules/
    
    # JIRA plugin atlassian-ide-plugin.xml
    
    # Crashlytics plugin (for Android Studio and IntelliJ) com_crashlytics_export_strings.xml crashlytics.properties crashlytics-build.properties fabric.properties
    
    ### JetBrains Patch ###
    # Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721
    
    # *.iml
    # modules.xml
    # .idea/misc.xml 
    # *.ipr
    
    • Now you can add your .idea folder back into your project directory and the changes won't be tracked any more.

提交回复
热议问题