본문 바로가기
Spring-Java/GitHub

GitHub Repository에 스프링 프로젝트 올리기

by 현대타운301 2023. 12. 9.

* 본 포스팅의 프로젝트 업로드는 STS3에서 진행했습니다.

 

 

GitHub Repository 생성 및 삭제

 

New Repository

1) 우측 사이드바 메뉴에서 'Your repositories' 클릭

 

2) 'New' 클릭

 

3) 필수 및 선택 정보 입력

 

4) 'Create repository' 클릭

 

* Readme?

누군가 당신의 repository에 방문했을 때 가장먼저 보게 될 아이템(= 글)

대게 아래와 같은 정보가 담겨있음

출처 : GitHub Docs

 

 

Delete repository

1) 삭제할 repository 클릭

 

2) 'Settings' 메뉴 클릭

 

3) 가장 아래 Danger Zone 메뉴에서 'Delete this repository' 클릭

 

4) 각 항목 차례대로 클릭 후 큰 따옴표(" ")안의 문장 입력

 

4) 'Delete this repository' 클릭

 


 

Token 발급

 

Tokens (classic)

Git 비밀번호 대신 사용하거나 혹은 Basic Authentication을 통한 API 인증에 사용됨

출처 : GitHub Docs

 

1) 우측 사이드바 메뉴에서 'Settings' 클릭

 

2) 좌측 메뉴에서 'Developers settings' 클릭

 

3) 'Personal access tokens' 메뉴에서 'Tokens (classic)' 클릭

 

4) 'Generate new token(classic)' 클릭

 

5) Note, Expiration, Select scopes 작성 후 'Generate token' 클릭

     - project 업로드는 'repo' 하나만 선택해도 가능

     - 나머지 scopes에 대한 자세한 설명은 여기 참고

 

6) [중요!] 화면에 나온 토큰 복사 후 메모장에 저장필수! (이후엔 볼 수 없음)

복사한 토큰을 password처럼 사용

 


 

Spring Project 업로드

 

Local Repository 생성

1) 업로드할 repository의 Code -> URL 복사 (copy 버튼 클릭)

 

2) STS Window 메뉴 -> Show View -> Other 클릭

 

3) git 검색 후 'Git Repositories' 선택 후 Open

 

4) 'Clone a Git repository' 클릭

 

5) URI, Email, Token 입력

 

6) 'Next' 클릭

 

7) Destination(경로) 설정

자동으로 remote repository(git)와 같은 이름의 local repository 디렉토리 생성

 

 

프로젝트 업로드(push)

1) 프로젝트 우클릭 -> Team -> Share Project 클릭

 

2) Repository 선택 후 'Finish' 클릭

 

3) 프로젝트 우클릭 -> Team -> Commit 클릭

 

4) Add(혹은 Add all) to the index

 

5) Commit Message 입력 후 'Commit and Push' 클릭

 

6) Email & Token 입력 후 'Log in' 클릭

 

7) push 완료 메세지 확인

 

 

8) Git repository 확인

 

 

* git workflow는 '프로젝트 업로드는 add -> commit -> push' 순으로 진행됨

  - git과 github의 차이점: git은 local에서 동작하는 버전 관리 tool이고, github는 git의 웹 호스팅 서비스(= cloud화)

 

출처 : https://www.geeksforgeeks.org/git-index/