younsik
younsik.tech
younsik
전체 방문자
오늘
어제

공지사항

  • 시리즈 모음
  • 분류 전체보기 (34)
    • Dev (17)
      • 일반 (2)
      • 환경세팅 (11)
      • Issue (4)
    • SpringBoot (4)
      • Boot (2)
      • JPA (2)
      • Redis (0)
      • Webflux (0)
    • ElasticStack (0)
      • Elasticsearch (0)
      • Logstash (0)
      • Kibana (0)
    • Docker&Kubernetes (0)
      • Docker (0)
      • Kubernetes (0)
    • Cloud (4)
      • AWS (4)
      • GCP (0)
    • Ops (2)
      • DevOps (1)
      • MLOps (1)
    • Database (1)
      • MySQL (1)
      • MongoDB (0)
      • Cassandra (0)
    • ML&DL (0)
      • Machine Learning (0)
      • Deep Learning (0)
    • Tensorflow (1)
      • Installation (1)
      • Basic (0)
      • TFX (0)
    • Pytorch (0)
      • Installation (0)
      • Basic (0)
    • Hands-on (5)
      • SpringBoot (5)

블로그 메뉴

  • 홈
  • Github
  • GitBlog
  • 태그
  • 방명록

링크 모음

실무 예제로 배우는 Elasticsearch 검색엔진

인기 글

태그

  • 개발환경
  • amvu
  • Beginner
  • mlops
  • AWS
  • ubuntu
  • Java
  • MAC
  • openjdk
  • Node
  • boot
  • 환경세팅
  • Intellij
  • Intel
  • codesource
  • Homebrew
  • GIT
  • m1
  • Issue
  • asdf
  • jenv
  • miniforge
  • JPA
  • Spring
  • erlang
  • zplug
  • MVC
  • docker
  • gradle
  • Kubeflow

최근 댓글

최근 글

hELLO · Designed By 정상우.
younsik

younsik.tech

[MVC] 2. Boot-Admin 프로젝트 Git 연동 (로컬)
Hands-on/SpringBoot

[MVC] 2. Boot-Admin 프로젝트 Git 연동 (로컬)

2022. 4. 30. 17:02

우선, Git을 사용하실 분들은 IntelliJ와 Gradle에서 불필요한 파일들을 git에 올리지 않기 위해서 .gitignore 파일을 생성합니다

 

루프 프로젝트 폴더에 해당하는 boot-admin을 클릭하고 오른쪽 클릭하신 다음에 New를 눌러서 File을 생성합니다

 

파일 이름은 .gitignore 로 생성합니다

 

.gitignore 파일에는 다음과 같이 작성합니다

 

### Maven template
target/
pom.xml.tag
pom.xml.releaseBackup
pom.xml.versionsBackup
pom.xml.next
release.properties
dependency-reduced-pom.xml
buildNumber.properties
.mvn/timing.properties
# https://github.com/takari/maven-wrapper#usage-without-binary-jar
.mvn/wrapper/maven-wrapper.jar

### Java template
# 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*

### JetBrains template
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
# 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/artifacts
# .idea/compiler.xml
# .idea/jarRepositories.xml
# .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

### Gradle template
.gradle
**/build/
!src/**/build/

# Ignore Gradle GUI config
gradle-app.setting

# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
!gradle-wrapper.jar

# Cache of project
.gradletasknamecache

# # Work around https://youtrack.jetbrains.com/issue/IDEA-116898
# gradle/wrapper/gradle-wrapper.properties

# 추가합니다
.idea

IntelliJ의 .gitignore 플러그인에서 생성되는 기본 템플릿(JetBrain + Gradle + Maven + Java) 입니다

 

마지막 라인에 .idea 를 추가해주세요

 

추가적으로 git을 사용하려면 IntelliJ에서 하단에서 Terminal을 눌러서 터미널 화면을 열어줍니다

기본적으로 루트 프로젝트의 위치에서 열립니다

 

다음과 같은 명령어로 git을 활성화 합니다

 

// 앞의 $ 표시는 터미널 화면에서 실행된다는 의미이므로 빼고 입력해주세요
$ git init

 

활성화 되면 다음과 같은 화면이 나옵니다

 

터미널로 git add .을 하셔서 commit을 하셔도 되고 IntelliJ에서 직접 커밋을 하셔도 됩니다

 

우선은 터미널로 git commit을 하고 다음부터는 IntelliJ에 내장된 VCS > Git을 이용해서 커밋을 해보겠습니다

 

다음 명령어를 실행합니다

$ git status

.gitignore 파일에서 설정한 위치의 파일들을 제외하고 git에서 추적할 수 있는 파일들이 보입니다

 

혹시라도 제외해야할 디렉토리(ex: .gradle 또는 .idea)나 파일들이 있다면 .gitignore에 다시 추가하고 다시 git status 로 확인합니다

 

확인이 되었으면 다음 명령어를 통해 현재 로컬의 git 저장소에 추가합니다

(git은 로컬 저장소와 원격 저장소가 분리되어 있으므로 현재는 로컬만 사용합니다)

$ git add .

git status 명령어로 확인하면 다음과 같이 나옵니다

 

 

확인되었으면 다음 명령어로 커밋을 합니다

$ git commit -m "init"

 

위 과정들을 통해서 git의 로컬 저장소에 현재 프로젝트의 내용을 저장해놓았습니다

 

다음 번에는 원격 저장소와 연결 시키는 방법을 해보도록 하겠습니다

저작자표시 비영리 변경금지 (새창열림)

'Hands-on > SpringBoot' 카테고리의 다른 글

[MVC] 5. Controller, ViewResolver(Thymeleaf) 구현  (0) 2022.05.12
[MVC] 4. 패키지 생성 및 git 브랜치 생성 및 커밋  (0) 2022.05.11
[MVC] 3. Boot-Admin 프로젝트 Git 연동 (원격)  (0) 2022.04.30
[MVC] 1. Boot-Admin 프로젝트 세팅 (IntelliJ + Gradle)  (0) 2022.04.30
    'Hands-on/SpringBoot' 카테고리의 다른 글
    • [MVC] 5. Controller, ViewResolver(Thymeleaf) 구현
    • [MVC] 4. 패키지 생성 및 git 브랜치 생성 및 커밋
    • [MVC] 3. Boot-Admin 프로젝트 Git 연동 (원격)
    • [MVC] 1. Boot-Admin 프로젝트 세팅 (IntelliJ + Gradle)
    younsik
    younsik
    younsik.tech의 기술 블로그

    티스토리툴바