skill/Git

git 생성, intelliJ Project 생성 후 연동

have a nice day :D 2023. 1. 30. 14:09
반응형

1. git hub에서 repository 추가
New > Create a new repository 에서 Repository name 추가 후 'Create repository' 버튼 클릭

2. IntelliJ Project 생성
Welcome to IntelliJ IDEA > New Project
(기본 : Spring , Gradle, log4j, jpa, mysql 연동)
좌측 Spring Initializr 클릭 > 
- Name : project 명 (편하게 repository 명과 동일)
- Location 지정 : ~/path/project 명
- Type : Gradle-Groovy
- Group : com.test.api (package명)
- Artifact: project 명
- Package name : Group 과 동일 
- Prjoect SDK : 11
- Java : 11
- Packaging : Jar
Next 클릭 
- Developer Tools : Lombok
- Web : Spring Web
- SQL : Spring Data JPA, Spring Data JDBC 
Finish 클릭

3. IntelliJ project와 git 연동
3-1. git code 확인
git repository 클릭 > Code 클릭 > Clone HTTPS 복사
3-2. intellij project open > Terminal >
-- 원격 저장소 연결
$git remote add origin https://github.com/.......repositor...........git (git repository url)
-- error 발생 시, 
fatal: not a git repository (or any of the parent directories): .git
$git init
-- 원격 저장소 재연결
$git remote add origin https://github.com/.......repositor...........git  (git repository url)
$git branch -M main
intellij project menu > Git > commit, push 확인

반응형

'skill > Git' 카테고리의 다른 글

git 전역 사용자 email 변경  (0) 2023.08.01
[Jenkins] Git 연동, FTP 연동 + 로그 확인  (0) 2023.05.03
git 파일 권한 추가  (0) 2022.06.02
sts git 연동 및 프로젝트 import  (1) 2020.09.24
sts git 연동, project import  (0) 2019.09.10