当前位置 博文首页 > nwsuafer的专栏:Android Studio下Svn忽略文件配置的几种方法

    nwsuafer的专栏:Android Studio下Svn忽略文件配置的几种方法

    作者:[db:作者] 时间:2021-07-15 09:50

    (一)新建项目的时候Android Studio向导会创建两个.gitignore,对应的,我们创建两个.svnignore就可以了。里面配置信息可以参考.gitignore,具体配置信息可以参考

    github推荐的.gitignore写法


    # built application files
    *.apk
    *.ap_
     
    # files for the dex VM
    *.dex
     
    # Java class files
    *.class
     
    # built native files
    *.o
    *.so
     
    # generated files
    bin/
    gen/
     
    # Ignore gradle files
    .gradle/
    build/
     
    # Local configuration file (sdk path, etc)
    local.properties
     
    # Proguard folder generated by Eclipse
    proguard/
     
    # Eclipse Metadata
    .metadata/
     
    # Mac OS X clutter
    *.DS_Store
     
    # Intellij IDEA (see https://intellij-support.jetbrains.com/entries/23393067)
    .idea/workspace.xml
    .idea/tasks.xml
    .idea/datasources.xml
    .idea/dataSources.ids


    http://myshittycode.com/2013/12/02/intellij-configuring-svn-ignored-files/

    SOLUTION 2: Add Ignored Files Using IntelliJ

    Based on the example above, there are 5 things we need to ignore:-

    • epicapp-ear/target/?directory
    • epicapp-war/target/?directory
    • target/?directory
    • .idea/?directory
    • *.iml?files

    So, in IntelliJ…

    1. Select “Changes” tab at the bottom.
    2. Select “Local” subtab.
    3. Click on “Configure Ignored Files” button.
      "Changes" tab
    4. In “Configure Ignored Files” dialog, click on the “+” button.
    5. Add the ignored file (or directory).
      "Configure Ignored Files" dialog

    6. Repeat step 4 and 5 until all ignored files are added.

    SOLUTION 3: Add Ignored Files Directly in?.idea/workspace.xml

    If you have quite a few files and directories to ignore, the above solution can be rather tedious.

    So, an alternative solution is to “hack”?.idea/workspace.xml?by entering all the ignored paths under “ChangeListManager” component:

    <?xml version="1.0" encoding="UTF-8"?>
    <project>
        <component name="ChangeListManager">
            ...
            <ignored path="epicapp-war/target/" />
            <ignored path="epicapp-ear/target/" />
            <ignored path=".idea/" />
            <ignored path=".settings/" />
            <ignored path="target/" />
            <ignored path=".DS_Store" />
            <ignored path=".classpath" />
            <ignored path=".project" />
            <ignored mask="*.iws" />
            <ignored mask="*~" />
            <ignored mask="*.bak" />
            <ignored mask="*.log" />
            <ignored mask="*.iml" />
        </component>
        ...
    </project>
    In this example, we ignore all? target ?folders, all IntelliJ generated files, all Eclipse generated files, all OS-specific generated files and some useless files.cs
    下一篇:没有了