[JAVA 웹 개발기록]국비 73일차

:)·2022년 6월 13일
0

✍개발 협업의 필수요소인 git(Eclipse)의 설정과 사용법을 배웠다.
곧 시작될 세미 프로젝트때 git사용을 제대로 못하면 역적이된다...
나를 위해서가 아닌 타인을 위해서도 꼭 알자

워크 스페이스 설정

1. 새로운 워크스페이스 파일 생성

2. 기본 초기 설정(UTF-8, view 등...)

	Winddow -> Show View -> other -> git(Repositories, Staging), history
    Preferences -> General -> Workspace -> other(UTF-8)
    			-> General -> Editors -> Text Editors -> Spelling -> Encoding(Default UTF-8)
    			-> Web -> CSS Files ->  Encoding{ISO Unicode(UTF-8)}
                	   -> HTML Files ->  Encoding{ISO Unicode(UTF-8)}
                	   -> JSP Files ->  Encoding{ISO Unicode(UTF-8)}
  				-> Java -> installed JREs -> 기존 JRE Remove -> add -> Standard VM -> 생성된 java 폴더(java-11)
                -> Java -> Compiler(level 11)

Eclipse git

1. .git 생성

생성된 파일 Team -> Share Project -> .git 생성

프로젝트 이름 = local repository , master = branch
.gitignore = git의 변경사항을 감지한다.

gitignore.io 사이트를 이용 gitignore의 세팅을 좀 더 쉽게한다.
https://www.toptal.com/developers/gitignore
생성된 코드를 .gitignore에 복사

2. 버전 만들기

GitStaging에서 버전만들기 git name, email 확인

CLI = watch dirty-> git add . -> stagung area -> git commit -m "message" -> version

GUI = 위 과정이 이미지의 1,2,3번이다

3. 사용법

아래에서 위로 작업 순서

Reset은 순서에 상관없이 Reset의 시점으로 돌아간다. Mixed = Unstaged Changes에 기록이 남는다 Hard = 기록이 없어지고 Reset시점으로 되돌아간다.

  1. animal branch 생성

  2. animal package Dog class 생성 bark(){"멍멍!"} , local repository commit
  3. Cat class도 1번과 같음bark(){"maio"}, local repository commit
  4. hello-git에서 animal에 있는 dog,cat 객체 임포트 후 dog.brak(), cat.brak() 기능 추가, local repository commit
    3.1 master(new branch #bugfix 추가)
  5. animal Dog#name 추가, bugfix bark(){"왈왈!"} 추가
  6. master가 bugfix를 marge, fast-forward merge
  7. master가 animal를 marge, merge
merge의 종류
1. fast-forward merge
	Never conflict! 절대 충돌나지 않는다
    master를 온전히 포함 했다면? fast-forward merge
2. non-fast-forward merge
	conflict! 의 위험성이 있다.    
  1. animal,bugfix이 master를 marge -> 하나의 commit
  1. animal Dog#breed 추가
  2. 고의로 8번과 같은 자리에 master Dog#color 추가, local repsiotry commit
  3. 같은 위치의 코드로 인해 Conflicts 메세지 생성, 구분자 제거 후 필드 값(breed, color) 재 배치 , 32ab72b

4. git hub

  1. git hub new repository 생성, 주소 복사
  2. New Remote (첫 별칭은origin) -> Change -> URL 복사한 주소 , User git name, Password(github access token)
    -> Finish(Store in Secure Store체크)
github access token 설정 방법 = github settings -> Developer settings
							-> Personal access tokens -> Generate new token -> Note 설정 후 유효기간 설정

  1. remote repo 설정하기(Ref Mappings) -> Advanced -> All Branches -> save

  2. Configure Fetch 실행 -> 3번과 동일한 과정

  3. Push 진행 (원격저장소로 local repository의 정보를 전송함)

6.mster.Snake 원격저장소 push (local repository commit -> Push 과정 진행

0개의 댓글