관리 메뉴

Dev Blog

1. IM Prep - Git workflow 본문

BootCamp_Codestates/IM Tech Blog

1. IM Prep - Git workflow

Nomad Kim 2020. 12. 3. 00:03

git flow

 

git clone 해 오면 자동으로 branch 이름은 master 가 됨.

git remote -v: remote 등록된 주소가 나옴.

remote repository 등록:

  • git remote add + pair(이름) + githubUrl of pair
  • git remote add + upstream(이름) + githubUrl of codestates

git pull origin master(branch 이름)

git pull pair master

git pull upstream master

 

merge : 하나로 합치기.

 

CLI, vi editor

esc => :q => 저장 안하고 탈출

esc => :wq => 저장하고 탈출

 

Git 충돌 해결

: 같은 레파지토리를 받아올 때 발생할 수 있는 충돌. 충돌 후 원하는 코드를 선택하면 된다.

 

Git Branching

$git checkout <브랜치 이름> : 작업공간 옮기기.

$git checkout -b <브랜치 이름> : 브랜치 생성 및 해당 브랜치로 작업공간 이동.

$git checkout <원본> then $git checkout -b <브랜치 이름>: 원본에 새 브랜치 만들고 이동하기.

 

Git workflow

 

Comments