๐Ÿฑ git & github ์ดˆ๋ณด ํƒˆ์ถœ ๐Ÿฑ

yeeun leeยท2020๋…„ 4์›” 1์ผ
1
post-custom-banner

1. git & github๋ž€?

Version Control System(VCS). ์ตœ์‹  ์ฝ”๋“œ์— ๋ฌธ์ œ๊ฐ€ ์žˆ์–ด ์ด์ „ ์ฝ”๋“œ๋กœ ๋Œ๋ฆฌ๊ฑฐ๋‚˜, ํŒ€ ๋‹จ์œ„ ๊ฐœ๋ฐœ์—์„œ ์—ฌ๋Ÿฌ ์ˆ˜์ • ์‚ฌํ•ญ์„ ๋ฐ˜์˜ํ•˜์—ฌ ํ•˜๋‚˜์˜ ๋ฒ„์ „์œผ๋กœ ๊ด€๋ฆฌํ•˜๊ฒŒ ํ•ด์ฃผ๋Š” ์‹œ์Šคํ…œ์ด๋‹ค.

๐ŸŒˆ VCS์˜ ๊ธฐ๋Šฅ

  • ์ฝ”๋“œ ๋ณ€๊ฒฝ history ๊ธฐ๋ก ๋ฐ ๊ด€๋ฆฌ
  • ํ•„์š”์‹œ ์ด์ „ ์ƒํƒœ๋กœ rollback
  • ํŒ€๋‹จ์œ„ ๊ฐœ๋ฐœ์‹œ ์ฒด๊ณ„์ ์ด๊ณ  ํšจ๊ณผ์ ์ธ ํ˜‘์—…

Git - ๋ถ„์‚ฐ ๋ฒ„์ „ ๊ด€๋ฆฌ ํˆด. ์†Œ์Šค ์ฝ”๋“œ์˜ ๋ณ€๊ฒฝ history๋ฅผ ๊ด€๋ฆฌํ•  ์ˆ˜ ์žˆ๋‹ค. ์—ฌ๊ธฐ์„œ version์€ ์†Œ์Šค ์ฝ”๋“œ(์ฝ”๋“œ ํŒŒ์ผ, server.js ๊ฐ™์€)์˜ ๋ฒ„์ „์„ ๋œปํ•œ๋‹ค.

Github - git์„ ์‚ฌ์šฉํ•˜๋Š” ํ”„๋กœ์ ํŠธ๋ฅผ ์ง€์›ํ•˜๋Š” ์›นํ˜ธ์ŠคํŒ… ์„œ๋น„์Šค. ๋กœ์ปฌ์— ๋ฒ„์ „ ๊ด€๋ฆฌ๋ฅผ ์œ„ํ•œ ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค ์„œ๋ฒ„๋ฅผ ๋งŒ๋“ค ํ•„์š” ์—†์ด, github๋กœ ํ•„์š”ํ•œ ์†Œ์Šค ์ฝ”๋“œ๋งŒ ๋‹ค์šด ๋ฐ›๋Š”๋‹ค. github๋Š” ์ค‘์•™ ์„œ๋ฒ„ ์™ธ์—๋„ ์ฝ”๋“œ ๋ฆฌ๋ทฐ, ๋ฌธ์„œ ์ƒ์„ฑ ๋ฐ ๊ด€๋ฆฌ, ํ”„๋กœ์ ํŠธ ์šด์˜ ๋“ฑ ์—ฌ๋Ÿฌ ๊ธฐ๋Šฅ์„ ์ œ๊ณตํ•œ๋‹ค.

- VCS server

Version database๋ฅผ ๊ด€๋ฆฌํ•˜๋Š” ์„œ๋ฒ„. ์ค‘์•™์—์„œ ์ €์žฅํ•˜๋Š”์ง€, ๋ถ„์‚ฐํ•ด์„œ ์ €์žฅํ•˜๋Š”์ง€์— ๋‹ค๋ฅด๋‹ค.

์ค‘์•™ ๋ฒ„์ „๊ด€๋ฆฌ ์‹œ์Šคํ…œ(central VCS)

์ค‘์•™ ์„œ๋ฒ„์— ์ˆ˜์ •๋œ ๋‚ด์šฉ์„ ์˜ฌ๋ ค ํŒ€์›๊ณผ ์ •๋ณด๋ฅผ ๊ณต์œ ํ•˜๋Š” ๊ฒƒ์„ ๊ฐ€๋Šฅํ•˜๊ฒŒ ํ•œ๋‹ค. ๋‚ ์งœ ๋“ฑ ๋ฉ”ํƒ€ ์ •๋ณด๋Š” ๋ชจ๋‘ ์„œ๋ฒ„์—์„œ ๊ด€๋ฆฌํ•˜๊ณ , ์ตœ์‹  ๋ฒ„์ „์˜ ์ฝ”๋“œ๋“ค๋งŒ ์ค‘์•™ ์„œ๋ฒ„์—์„œ ๋‹ค์šด๋กœ๋“œํ•ด ์ž‘์—…ํ•˜๋Š” ํ˜•์‹์ด๋‹ค.

๋ถ„์‚ฐ ๋ฒ„์ „๊ด€๋ฆฌ ์‹œ์Šคํ…œ(Distributed VCS)

Central VCS๋Š” ์„œ๋ฒ„๊ฐ€ ๋‹ค์šด๋˜๋ฉด ๋งค์šฐ ํฐ์ผ๋‚œ๋‹ค. Distributed VCS๋ฅผ ์“ฐ๊ฒŒ ๋˜๋ฉด ๊ฐ ๊ฐœ๋ฐœ์ž์˜ ์ปดํ“จํ„ฐ๋„ ๋ชจ๋“  ๋ฉ”ํƒ€ ์ •๋ณด๋ฅผ ๊ฐ€์ง€๊ณ  ์žˆ์–ด ์ค‘์•™ ์„œ๋ฒ„์— ๋ฌธ์ œ๊ฐ€ ์ƒ๊ฒจ๋„ ๊ฐœ๋ฐœ์ž ์ปดํ“จํ„ฐ๋ฅผ ํ†ตํ•ด ๋ณต๊ตฌ๊ฐ€ ๊ฐ€๋Šฅํ•˜๊ฒŒ ๋œ๋‹ค.

2. repository

๊ฐ„๋‹จํ•˜๊ฒŒ ๋งํ•˜๋ฉด ์ €์žฅ์†Œ์ด๋‹ค. ๋กœ์ปฌ๊ณผ ์›๊ฒฉ์œผ๋กœ ๊ตฌ๋ถ„๋œ๋‹ค. ๋ณดํ†ต ๋กœ์ปฌ ๋ฆฌํฌ์—์„œ ์ž‘์—…์„ ํ•˜๋‹ค ๋‚ด ์†Œ์Šค ์ฝ”๋“œ๋ฅผ ๊ณต๊ฐœํ• ๋•Œ ์›๊ฒฉ ๋ฆฌํฌ์— ์—…๋กœ๋“œ(push)ํ•˜๊ฒŒ ๋œ๋‹ค

2.1 local & remote

local repo

๋‚ด ์ปดํ“จํ„ฐ์— ์ €์žฅ๋˜๋Š” ๊ฐœ์ธ ์ „์šฉ ์ €์žฅ์†Œ์ด๋‹ค. ํ˜ผ์ž์„œ ์ž‘์—…ํ•˜๋Š” ๊ฒฝ์šฐ ์›๊ฒฉ ์ €์žฅ์†Œ๋ฅผ ์‚ฌ์šฉํ•˜๋Š” ๊ฒฝ์šฐ๊ฐ€ ๋งŽ์ง€ ์•Š๋‹ค. git์ด ๊ด€๋ฆฌํ•˜๋Š” ์„ธ ๊ทธ๋ฃจ์˜ ๋‚˜๋ฌด๋กœ ๊ตฌ์„ฑ๋˜์–ด ์žˆ๋‹ค.

  • working directory: ์‹ค์ œ ํŒŒ์ผ๋กœ ์ด๋ฃจ์–ด์ ธ ์žˆ๋‹ค.
  • index(stage): ์ค€๋น„์˜์—ญ์˜ ์—ญํ• ์„ ํ•œ๋‹ค. ์ €์žฅ์†Œ์— ์—…๋กœ๋“œํ•˜๊ธฐ ์ „์— ์ €์žฅํ•˜๊ณ  ์›ํ•˜๋Š” ํŒŒ์ผ๋งŒ ์—…๋กœ๋“œํ•˜๊ณ  ์‹ถ์„ ๋•Œ ์“ด๋‹ค - ์ด๋ฅผ staging์ด๋ผ๊ณ  ํ•œ๋‹ค.
  • head: ์ตœ์ข… ํ™•์ •๋ณธ(commit)์„ ๋‚˜ํƒ€๋‚ธ๋‹ค.

remote repo

์—ฌ๋Ÿฌ ์‚ฌ๋žŒ์ด ๊ณต์œ ํ•˜๊ธฐ ์œ„ํ•œ ์ €์žฅ์†Œ๋กœ, ํด๋ผ์šฐ๋“œ์™€ ๋น„์Šทํ•œ ๊ฐœ๋…์ด๋‹ค. ์›๊ฒฉ์ €์žฅ์†Œ๋Š” ์†Œ์Šค ์ฝ”๋“œ๋ฅผ ๋ฐฑ์—…ํ•˜๊ณ  ๋‹ค๋ฅธ์‚ฌ๋žŒ๊ณผ ํ˜‘์—…ํ•˜๊ธฐ ์œ„ํ•ด ์‚ฌ์šฉํ•œ๋‹ค.

2.2 ๋ช…๋ น์–ด

- git init

ํ”„๋กœ์ ํŠธ๋ฅผ git repository๋กœ ๋งŒ๋“ค๊ธฐ ์œ„ํ•ด์„œ ์‚ฌ์šฉํ•˜๋Š” ๋ช…๋ น์–ด. ์—ฌ๊ธฐ์„œ ํ”„๋กœ์ ํŠธ(project)๋ผ ํ•จ์€ ๊ฐœ๋ฐœํ•˜๊ณ ์ž ํ•˜๋Š” ์†Œ์Šค์ฝ”๋“œ๋“ค์ด ์žˆ๋Š” ๋””๋ ‰ํ† ๋ฆฌ๋ฅผ ๋งํ•œ๋‹ค. git init์„ ํ•ด์„œ git repo๋กœ ๋งŒ๋“ค์–ด์•ผ git์œผ๋กœ ๋ฒ„์ „ ๊ด€๋ฆฌ๊ฐ€ ์‹œ์ž‘๋œ๋‹ค.

/dir $ git init

์›๊ฒฉ ์ €์žฅ์†Œ๋ฅผ ๋กœ์ปฌ ์ €์žฅ์†Œ์— ์ €์žฅํ•˜๋Š” ๋ช…๋ น์–ด

โฏ git remote add origin https://github.com/yenilee/first.git

- git remote -v

ํ˜„์žฌ ์›๊ฒฉ ์ €์žฅ์†Œ์˜ ์ƒํƒœ๋ฅผ ํ™•์ธ

โฏ git remote -v
origin	https://github.com/wecode-bootcamp-korea/git4.git (fetch)
origin	https://github.com/wecode-bootcamp-korea/git4.git (push)

2.3 clone & pull

- git pull

๋‹ค๋ฅธ ์‚ฌ๋žŒ๋“ค์ด ์ถ”๊ฐ€ํ•œ ์ฝ”๋“œ๊ฐ€ ๋ฐ˜์˜๋œ ๊ฐ€์žฅ ์ตœ์‹ ๋ฒ„์ „์˜ ์ฝ”๋“œ๋ฅผ ๊ฐ€์ ธ์˜ค๋Š” ๊ฒƒ (= git fetch + git merged). fetch๋Š” ํ”„๋กœ์ ํŠธ์˜ ๋ฉ”ํƒ€ ์ •๋ณด๋ฅผ ๊ฐ€์ ธ์˜ค๋Š” ๊ฒƒ์ด๊ณ , pull์„ ํ•ด์•ผ ์ตœ์‹ ์œผ๋กœ ์—…๋ฐ์ดํŠธ ๋œ ์ฝ”๋“œ ์ •๋ณด๋ฅผ ๊ฐ€์ ธ์˜ฌ ์ˆ˜ ์žˆ๋‹ค.

์›ํ•˜๋Š” branch๋ฅผ ๊ฐ€์ ธ์˜ค๊ธฐ ์œ„ํ•ด์„œ๋Š” branch name์„ ์ง€์ •ํ•ด์„œ ์ฃผ์–ด์•ผ ํ•œ๋‹ค.

#master branch pull ํ•ด์˜ค๊ธฐ 
git pull origin master 

- git clone

remote repo์—์„œ local repo๋กœ ์†Œ์Šค ์ฝ”๋“œ๋ฅผ ๋ณต์‚ฌํ•ด์„œ ๊ฐ€์ ธ์˜ค๋Š” ๊ฒƒ. ๊ฐ™์ด ์ž‘์—…ํ•ด์„œ ํ•ฉ์น˜๋Š” ๊ธฐ๋Šฅ๋ณด๋‹ค๋Š” ์ฝ”๋“œ๋ฅผ ๋ณต์‚ฌํ•˜๋Š” ์šฉ๋„์— ๊ฐ€๊นŒ์šด ๊ฒƒ ๊ฐ™๋‹ค. github์˜ url์„ ํ†ตํ•ด ๋ณต์‚ฌํ•˜๋Š” ๋ฐฉ๋ฒ•์€ ๋‹ค์Œ๊ณผ ๊ฐ™๋‹ค.

git clone (github์—์„œ ๋ณต์‚ฌํ•œ ์›๊ฒฉ ์ €์žฅ์†Œ์˜ ๋งํฌ)

- git fork

remote repo์—์„œ github ๊ณ„์ •์œผ๋กœ ์†Œ์Šค ์ฝ”๋“œ๋ฅผ ๋ณต์‚ฌํ•˜๋Š” ๊ฒƒ

3. branch

๋ฒ„์ „ ๊ด€๋ฆฌ๋ฅผ ํ•  ๋•Œ, git์€ ๋ฐ”๋€ ๋ถ€๋ถ„๋งŒ(diff) ์ €์žฅํ•˜๋Š”๊ฒŒ ์•„๋‹ˆ๋ผ ํŒŒ์ผ์˜ ์Šค๋ƒ…์ƒท(snapshot)์„ ์‹œ๊ฐ„์ˆœ์œผ๋กœ ์ €์žฅํ•œ๋‹ค. ๊ทธ๋ž˜์„œ ํ˜„์žฌ์˜ ์Šค๋ƒ…์ƒท๊ณผ ์ด์ „ ์Šค๋ƒ…์ƒท์„ ๋น„๊ตํ•˜๋ฉฐ ๋ณ€๊ฒฝ ์‚ฌํ•ญ์„ ๋ณด๋Š” ๊ฒƒ์ด๋‹ค. ๊ฐœ๋ฐœ์ž๊ฐ€ ์ค‘์•™ ์„œ๋ฒ„์—์„œ ๋ฆฌํฌ๋ฅผ ์ฒดํฌ์•„์›ƒํ•˜๋ฉด ํ•ด๋‹น ๋ฆฌํฌ์˜ ํŠน์ •ํ•œ ์‹œ์ ์˜ ์Šค๋ƒ…์ƒท์„ ๋ฐ›๊ฒŒ๋œ๋‹ค.

๐ŸŒˆ branch์—์„œ ์ผ์–ด๋‚˜๋Š” ์ผ๋“ค์„ ๋ฏธ๋ฆฌ ์š”์•ฝํ•ด๋ณด๋ฉด

  • ๊ธฐ์ค€์ด ๋˜๋Š” ๋งˆ์Šคํ„ฐ ๋ธŒ๋žœ์น˜์— ์ฒดํฌ์•„์›ƒcheckoutํ•˜๊ณ 
  • ๋‚ด ๋ธŒ๋žœ์น˜feature branch๋ฅผ ๋งŒ๋“  ๋‹ค์Œ
  • ๋‚ด์šฉ์„ ์ˆ˜์ •ํ•˜๊ณ  add, commit, pushํ•˜๊ณ 
  • pull request๊ฐ€ ์ˆ˜๋ฝ๋˜๋ฉด ๋งˆ์Šคํ„ฐ ๋ธŒ๋žœ์น˜ ๋ฐ˜์˜merge !

3.1 ๋ช…๋ น์–ด

- ์ƒ์„ฑ

git branch feature/yeni # ๋งŒ๋“ค๊ธฐ๋งŒ ํ•˜๊ณ  ์ด๋™ํ•˜์ง€ ์•Š์Œ
git checkout -b newfeature # ์ƒˆ๋กœ ๋งŒ๋“  ๋‹ค์Œ ๋ฐ”๋กœ ์ด๋™ 

- ์ด๋™

git checkout master
git checkout feature/yeni

- ํ™•์ธ

๋‚ด๊ฐ€ ์–ด๋–ค ๋ธŒ๋žœ์น˜์— ์žˆ๋Š”์ง€ ํ™•์ธํ•˜๋Š” ๊ฒƒ. master branch์—์„œ ์ž‘์—…ํ•˜๋ฉด ์•ˆ ๋˜๊ณ  branch์—์„œ ์ž‘์—…ํ•œ ๋’ค์— Mergeํ•˜๋Š” ๋‹จ๊ณ„๋ฅผ ๊ฑฐ์ณ์•ผ ํ•œ๋‹ค.

git branch -v 

- ์ œ๊ฑฐ

git branch -d new_feature 

4. git flow

4.1 modified

์ฝ”๋“œ๊ฐ€ ์ˆ˜์ •๋˜์—ˆ์ง€๋งŒ ์•„์ง ์ €์žฅ๋˜์ง€(commited) ์•Š์€ ์ƒํƒœ๋ฅผ ๋งํ•œ๋‹ค. ์ฝ”๋“œ๋ฅผ ์ˆ˜์ •ํ•˜๊ณ  ์ƒํƒœ๋ฅผ ํ™•์ธํ•˜๋ฉด modified: ์ˆ˜์ •๋œ ํŒŒ์ผ์ด๋ผ๊ณ  ๋ถ‰์€ ๊ธ€์”จ๊ฐ€ ๋œฌ๋‹ค. ๋ณ€๊ฒฝ ์‚ฌํ•ญ์ด stage๋˜์ง€ ์•Š์•˜๋‹ค๊ณ  ๋‚˜์˜จ๋‹ค.

โฏ git status
On branch master
Your branch is up to date with 'origin/master'.

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
	modified:   README.md

4.2 staged

์œ„ ์ƒํƒœ์—์„œ staged ๋˜๋ฉด modified ํŒŒ์ผ์˜ ๊ธ€์”จ๊ฐ€ ์ดˆ๋ก์ƒ‰์œผ๋กœ ๋ณ€ํ•˜๊ณ , ๋‚ด๊ฐ€ ์ˆ˜์ •ํ•œ ๊ฒƒ์ด commit ๋  ๊ฒƒ์ด๋ผ๊ณ  markํ•œ ์ƒํƒœ๋กœ๋ณ€ํ•œ๋‹ค.

โฏ git add README.md
โฏ git status
On branch feature/yeni
Changes to be committed:
  (use "git restore --staged <file>..." to unstage)
	modified:   README.md

- git add(=staging)

์ˆ˜์ •ํ•œ ํŒŒ์ผ์„ staged ์ƒํƒœ๋กœ ์˜ฎ๊ธฐ๊ณ ์ž ํ• ๋•Œ ์‚ฌ์šฉํ•˜๋Š” ๋ช…๋ น์–ด. ๋˜ git repo์— ์ƒˆ๋กœ์ด ์ถ”๊ฐ€๋œ ํŒŒ์ผ๋“ค์„ staged ์ƒํƒœ๋กœ ์˜ฎ๊ธธ๋•Œ๋„ ์‚ฌ์šฉ๋œ๋‹ค. ์ƒˆ๋กœ์ด ์ถ”๊ฐ€๋œ ํŒŒ์ผ๋“ค์€ "untracked" ํŒŒ์ผ ์ด๋ผ๊ณ  ํ•˜๋Š”๋ฐ, git์—์„œ๋Š” ์ด๋“ค๋„ ์ˆ˜์ • ์‚ฌํ•ญ์œผ๋กœ ๋ณธ๋‹ค.

$ git add newfile #  newfile์„ index์— ๋“ฑ๋กํ•˜๊ธฐ
$ git add . # ๋ชจ๋“  ํŒŒ์ผ์„ index์— ๋“ฑ๋กํ•˜๊ธฐ

- git restore --staged

unstage ํ•ด์„œ ๋‹ค์‹œ ์ˆ˜์ •ํ•˜๊ณ  ์‹ถ์„ ๋•Œ ์‚ฌ์šฉํ•˜๋Š” ๋ช…๋ น์–ด. ๊ณ„์† ๋งํ•˜์ง€๋งŒ commit ํ•˜๋ฉด ๋˜๋Œ๋ฆฌ๋Š”๊ฒŒ ๋ฒˆ๊ฑฐ๋กญ๊ธฐ ๋•Œ๋ฌธ์— ํ™•์ •์ด ์•„๋‹ˆ๋ผ๋ฉด stage - unstage ํ•˜๋ฉด์„œ ๊ณ„์† ์ˆ˜์ •ํ•ด์•ผ ํ•œ๋‹ค!

4.3 commited

์ˆ˜์ • ์‚ฌํ•ญ๋“ค์ด ๋ฉ”์‹œ์ง€์™€ ํ•จ๊ป˜ local git์— ์ €์žฅ๋œ ์ƒํƒœ. commitํ•˜๊ฒŒ ๋˜๋ฉด ํžˆ์Šคํ† ๋ฆฌ์— ๋‚จ๊ณ , ์ถ”๊ฐ€ ์ˆ˜์ •์‚ฌํ•ญ์ด ์žˆ์„ ๋•Œ ๋˜๋Œ๋ฆฌ๋Š”๊ฒŒ ๊นŒ๋‹ค๋กœ์šธ ์ˆ˜ ์žˆ์–ด(๋กœ๊ทธ๋ฅผ ํ™•์ธํ•ด์„œ ์‹œ๊ฐ„ ์—ฌํ–‰์„ ํ•ด์•ผ ํ•˜๋Š”...) staged ๋‹จ๊ณ„๊ฐ€ ํ•„์š”ํ•œ ๊ฒƒ์ด๋‹ค.

โฏ git commit -m "problem solved"
[feature/yeni a17c25c] problem solved

- git commit -m 'message'

์ˆ˜์ •์‚ฌํ•ญ์„ local์— ๋ฉ”์‹œ์ง€์™€ ํ•จ๊ป˜ ์ €์žฅํ•œ๋‹ค. remote repo์— ์žˆ๋Š” ๋งˆ์Šคํ„ฐ์— mergeํ•˜๊ธฐ ์ „ ์ƒํƒœ.

- git push origin branch

mergeํ•˜๊ธฐ ์œ„ํ•ด branch๋ฅผ remote repo์— ๋“ฑ๋กํ•œ ์ƒํƒœ. github์— ๊ฐ€๋ณด๋ฉด ๋‚˜์˜ branch์—์„œ ์ €์žฅ๋œ ๋ณ€๊ฒฝ ์‚ฌํ•ญ์„ ํ™•์ธํ•  ์ˆ˜ ์žˆ๊ณ , master์— ์ ์šฉ์‹œํ‚ค๊ธฐ ์œ„ํ•ด์„œ๋Š” pull request๋ฅผ ํ•ด์•ผ ํ•œ๋‹ค.

โฏ git push origin feature/yeni
Enumerating objects: 5, done.
Counting objects: 100% (5/5), done.
Delta compression using up to 8 threads
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 281 bytes | 281.00 KiB/s, done.
Total 3 (delta 1), reused 0 (delta 0)
remote: Resolving deltas: 100% (1/1), completed with 1 local object.
To https://github.com/wecode-bootcamp-korea/git4.git
   90d9e7c..119bb30  feature/yeni -> feature/yeni

์œ„ git push origin feature/yeni ์—์„œ origin์€ remote์—์„œ ์„ค์ •ํ•œ ์ €์žฅ์†Œ๋กœ ์ด๋™ํ•˜๊ฒŒ ํ•œ๋‹ค. feature๋Š” ๋ณดํ†ต master์—์„œ branch๋ฅผ ๋งŒ๋“ค ๋•Œ ์‚ฌ์šฉํ•˜๋Š” ์ด๋ฆ„์ด๋‹ค.

4.4 conflict

ํ˜‘์—…์ž๋ผ๋ฆฌ ๊ฐ™์€ ์ฝ”๋“œ๋ฅผ ๋‹ค๋ฅด๊ฒŒ ๊ณ ์ณค์„ ๊ฒฝ์šฐ ๋ฐœ์ƒํ•œ๋‹ค. ์„  Merge ํ›„ pull-request๋ฅผ ํ•˜๊ฒŒ ๋˜๋ฉด, ํ•ฉ์ณค์„ ๋•Œ conflict๊ฐ€ ๋ฐœ์ƒํ•˜๋Š” ๊ฒƒ์„ ์‚ฌ์ „์— ์•Œ ์ˆ˜ ์žˆ์–ด ์–ด๋–ค ์ฝ”๋“œ๋ฅผ ๋‚จ๊ธธ์ง€ ์ •ํ•˜๊ณ  ๋‚จ๊ธธ ์ฝ”๋“œ๋ฅผ ์ •ํ•ด commitํ•˜๋ฉด ๋œ๋‹ค.

๋งŒ์•ฝ ๋‚ด๊ฐ€ ์˜ฌ๋ฆฐ pull request๊ฐ€ conflict ๋˜๋Š” ์ƒํ™ฉ์ด๋ฉด, branch๋ฅผ pullํ•˜๋ ค๊ณ  ํ–ˆ์„ ๋•Œ ์•„๋ž˜์™€ ๊ฐ™์ด merge๊ฐ€ failํ–ˆ๋‹ค๊ณ  ๋œฌ๋‹ค.

โฏ git checkout feature/yeni
โฏ git pull origin master
remote: Enumerating objects: 1, done.
remote: Counting objects: 100% (1/1), done.
remote: Total 1 (delta 0), reused 0 (delta 0), pack-reused 0
Unpacking objects: 100% (1/1), done.
From https://github.com/wecode-bootcamp-korea/git4
 * branch            master     -> FETCH_HEAD
   6dc29c7..bf5008d  master     -> origin/master
Auto-merging README.md
CONFLICT (content): Merge conflict in README.md
Automatic merge failed; fix conflicts and then commit the result.
profile
์ด์‚ฌ๊ฐ„ ๋ธ”๋กœ๊ทธ: yenilee.github.io
post-custom-banner

0๊ฐœ์˜ ๋Œ“๊ธ€