[Git] Git 시작하기- Git gitignore 파일 설정하기(파일 제외)

Posted by 김성철

Git - Git gitignore 파일 설정하기(파일 제외)

참고 URL :

https://m.blog.naver.com/PostView.nhn?blogId=simpolor&logNo=221065977618&proxyReferer=https:%2F%2Fwww.google.com%2F  
  
* 깃에서 플러그인으로 바로 설정도 가능함. 플러그인으로 하는게 더 빠르고 편리함  
https://gbsb.tistory.com/409  

명령어 사용 방법
.gitignore 파일 작성 후 실행
=================================================================================================================
=================================================================================================================
git rm -r –cached .
git add .
git commit -m “.gitignore 파일 적용”

.플러그인 사용 방법

=====================================================================================================================================================

  1. 컨트롤 + 알트 + S 를 눌러서 인텔리J 셋팅창을 실행

  2. 좌측 검색부분에서 plugins 를 검색
    [Settings] -> [plugins]

  3. 플러그인 검색창에서 ignore 검색

  4. .ignore 설치

  5. 인텔리J에서 좌측상단의 [File] -> [New] -> [ignore File] -> [.gitignore file (Git)] 선택

  6. 새로 실행되는 창 [Ignore File Generator] 에서 제외할 언어들을 선택 후 [Generate] 클릭 하면 파일이 생성됨

.gitignore 파일 직접 생성 방법

=====================================================================================================================================================

깃에 업로드할 때 제외할 파일 설정

URL : http://gitignore.io/  

1.위의 URL 에 접속하여 사용하는 운영체제, 개발툴, 개발언어 등을 입력하고 엔터를 치면 제일 하단과 같이 제외해야될 내용들이 나옴

  1. 깃에 업로드하는 프로젝트디렉토리의 최상위로 이동 (.git 폴더와 동일한 위치)
    ex) CIIM_manager 프로젝트의 경우 C:\CIIM_manager

  2. 해당 디렉토리에 .gitignore 파일 생성
    텍스트 파일로 생성해서 확장자를 지우고 파일명을 저렇게 변경하면 됨

  3. http://gitignore.io/ 에서 받아온 텍스트를 채운 후 저장

  4. 해당 파일을 커밋하여 추가

  5. 깃에 업로드

※ 아래부터는 제외할 내용들을 http://gitignore.io/ 에서 받아온 것임
※ java ,maven, windows, intellij 네개를 설정

Created by https://www.gitignore.io/api/java,maven,windows,intellij

Edit at https://www.gitignore.io/?templates=java,maven,windows,intellij

Intellij

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

*.iml

*.ipr

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

Intellij Patch

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

*.iml

modules.xml

.idea/misc.xml

*.ipr

Sonarlint plugin

.idea/**/sonarlint/

SonarQube Plugin

.idea/**/sonarIssues.xml

Markdown Navigator plugin

.idea//markdown-navigator.xml
.idea/
/markdown-navigator/

Java

Compiled class file

*.class

Log file

*.log

BlueJ files

*.ctxt

Mobile Tools for Java (J2ME)

.mtj.tmp/

Package Files

*.jar
*.war
*.nar
*.ear
*.zip
*.tar.gz
*.rar

virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml

hs_err_pid*

Maven

target/
pom.xml.tag
pom.xml.releaseBackup
pom.xml.versionsBackup
pom.xml.next
release.properties
dependency-reduced-pom.xml
buildNumber.properties
.mvn/timing.properties
.mvn/wrapper/maven-wrapper.jar
.flattened-pom.xml

Windows

Windows thumbnail cache files

Thumbs.db
Thumbs.db:encryptable
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/java,maven,windows,intellij