ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • [Git] .gitignore 자동 생성 및 적용하기
    👀 etc... 2020. 5. 15. 16:16

    ○  gitignore.io

     

     

    검색창에 운영체제, 개발환경(IDE), 프로그래밍 언어를 검색하면 .gitignore 파일을 자동으로 생성해 줍니다.

     

     

     .gitignore 파일이란?


    프로젝트에 원하지 않는 백업 파일이나 로그파일 혹은 컴파일 된 파일들을 Git에서 제외시킬 수 있는 설정파일
    한마디로 깃허브에 커밋할때 필요하지 않는 파일은 업뎃 시키지 않는 기능입니다. 

     

     

     

    이렇게 생성하면

     

    # Created by https://www.gitignore.io/api/androidstudio
    # Edit at https://www.gitignore.io/?templates=androidstudio
    
    ### AndroidStudio ###
    # Covers files to be ignored for android development using Android Studio.
    
    # Built application files
    *.apk
    *.ap_
    
    # Files for the ART/Dalvik VM
    *.dex
    
    # Java class files
    *.class
    
    # Generated files
    bin/
    gen/
    out/
    
    # Gradle files
    .gradle
    .gradle/
    build/
    
    # Signing files
    .signing/
    
    # Local configuration file (sdk path, etc)
    local.properties
    
    # Proguard folder generated by Eclipse
    proguard/
    
    # Log Files
    *.log
    
    # Android Studio
    /*/build/
    /*/local.properties
    /*/out
    /*/*/build
    /*/*/production
    captures/
    .navigation/
    *.ipr
    *~
    *.swp
    
    # Android Patch
    gen-external-apklibs
    
    # External native build folder generated in Android Studio 2.2 and later
    .externalNativeBuild
    
    # NDK
    obj/
    
    # IntelliJ IDEA
    *.iml
    *.iws
    /out/
    
    # User-specific configurations
    .idea/caches/
    .idea/libraries/
    .idea/shelf/
    .idea/workspace.xml
    .idea/tasks.xml
    .idea/.name
    .idea/compiler.xml
    .idea/copyright/profiles_settings.xml
    .idea/encodings.xml
    .idea/misc.xml
    .idea/modules.xml
    .idea/scopes/scope_settings.xml
    .idea/dictionaries
    .idea/vcs.xml
    .idea/jsLibraryMappings.xml
    .idea/datasources.xml
    .idea/dataSources.ids
    .idea/sqlDataSources.xml
    .idea/dynamic.xml
    .idea/uiDesigner.xml
    .idea/assetWizardSettings.xml
    
    # OS-specific files
    .DS_Store
    .DS_Store?
    ._*
    .Spotlight-V100
    .Trashes
    ehthumbs.db
    Thumbs.db
    
    # Legacy Eclipse project files
    .classpath
    .project
    .cproject
    .settings/
    
    # Mobile Tools for Java (J2ME)
    .mtj.tmp/
    
    # Package Files #
    *.war
    *.ear
    
    # virtual machine crash logs (Reference: http://www.java.com/en/download/help/error_hotspot.xml)
    hs_err_pid*
    
    ## Plugin-specific files:
    
    # mpeltonen/sbt-idea plugin
    .idea_modules/
    
    # JIRA plugin
    atlassian-ide-plugin.xml
    
    # Mongo Explorer plugin
    .idea/mongoSettings.xml
    
    # Crashlytics plugin (for Android Studio and IntelliJ)
    com_crashlytics_export_strings.xml
    crashlytics.properties
    crashlytics-build.properties
    fabric.properties
    
    ### AndroidStudio Patch ###
    
    !/gradle/wrapper/gradle-wrapper.jar
    
    # End of https://www.gitignore.io/api/androidstudio

     

     

    깃허브에 생략되어야할 파일들이 운영체제, IDE, 프로그래밍언어별로 생성이 되고 그대로 .gitignore파일에 복붙

     

     

     

     

    그 다음, 

    git bash로 명령어를 입력하여 적용시켜줍니다.

     

    git rm -r --cached .
    git add .
    git commit -m "Apply .gitignore"

    댓글

Designed by Tistory.