Jane K 2022. 7. 7. 01:33

1. 3-Way-Merge : !!! ๋‹ค์‹œ ์„ค๋ช… !!!

์ž์„ธํ•˜๊ฒŒ ๋‚˜์˜ค์ง€๋งŒ ๊ฐ€์ง€๊ฐ€ ์ง€์ €๋ถ„ํ•ด์ ธ์„œ ๋งŽ์ด ์„ ํ˜ธํ•˜์ง„ ์•Š์Œ

 

1)

checkout : ๋ธŒ๋žœ์น˜ ์ „ํ™˜์—๋งŒ ์“ฐ๋Š” ๋ช…๋ น์–ด๊ฐ€ ์•„๋‹˜

switch : ์ƒˆ๋กœ์ƒ๊ธด ๋ธŒ๋žœ์น˜ ์ „ํ™˜์— ์“ฐ๋Š” ๋ช…๋ น์–ด

 

2) ์ต์Šคํ…์…˜์œผ๋กœ ๋” ์ง๊ด€์ ์œผ๋กœ ๋ณด๊ธฐ

git graph ์„ค์น˜, ์™ผ์ชฝ์˜ ๊ฒ€์ƒ‰๋ฒ„ํŠผ ๋ฐ‘์— ํด๋ฆญ, ์ฒดํฌ ๋ฒ„ํŠผ ์˜†์˜†์˜ ๊ทธ๋ž˜ํ”„ ๋ฒ„ํŠผ ํด๋ฆญํ•˜๋ฉด log graph ์ง๊ด€์ ์ด๊ฒŒ ํ‘œ์‹œ๋˜์–ด ๋‚˜์˜ด

 

 

2. rebase ๋ฆฌ๋ฒ ์ด์Šค : ๊ทธ๋ž˜ํ”„์—์„œ ๋จธ์ง€๋ผ๊ณ  ์ž์„ธํ•˜๊ฒŒ ํ‘œ์‹œํ•˜๊ณ  ์‹ถ์ง€ ์•Š๋‹ค !!! ๋‹ค์‹œ ์„ค๋ช… !!!

๋ฆฌ๋ฒ ์ด์Šค๋Š” ์ž๋ฆฌ๋ฅผ ๋์œผ๋กœ ์˜ฎ๊ฒจ์ฃผ๋Š” ๊ฒƒ

git rebase main : 3์›จ์ด ์ปค๋ฐ‹์œผ๋กœ ๊ฐ€์ง€๊ฐ€ ์ƒ๊ธด ๊ฒƒ์„ ๊น”๋”ํ•˜๊ฒŒ ํ•ฉ์ณ์ ธ ์žˆ์Œ

!!! ์ฃผ์˜ : ???

 

1) switch ๋กœ ์ด๋™ํ•˜๋ฉด์„œ ๋งŒ๋“ค๊ธฐ

git switch -c new : -c ๋Š” create

 

!! ๊ณผ์ œ : newb ๋ธŒ๋žœ์น˜ ๋งŒ๋“ค๊ณ , newb.html ์ƒ์„ฑ, commit ๊ธฐ๋ก, ๋ฉ”์ธ์—์„œ f.html ์ƒ์„ฑ, commit ๊ธฐ๋ก, newb ๋ฅผ ๋ฆฌ๋ฒ ์ด์Šค, ํŽ˜์ŠคํŠธ ํฌ์›Œ๋“œ๋กœ ๋จธ์ง€

→ ์ฝ”๋”ฉ

kimhy@LAPTOP-9MVGLEHR MINGW64 ~/Desktop/git/Helpgitbox (main)

$ git switch -c newB

Switched to a new branch 'newB'

 

kimhy@LAPTOP-9MVGLEHR MINGW64 ~/Desktop/git/Helpgitbox (newB)

$ git add .

 

kimhy@LAPTOP-9MVGLEHR MINGW64 ~/Desktop/git/Helpgitbox (newB)

$ git commit -m 'add newB.html'

[newB 76d34b2] add newB.html

 1 file changed, 0 insertions(+), 0 deletions(-)

 create mode 100644 newB.html

 

kimhy@LAPTOP-9MVGLEHR MINGW64 ~/Desktop/git/Helpgitbox (newB)

$ git switch main

Switched to branch 'main'

 

kimhy@LAPTOP-9MVGLEHR MINGW64 ~/Desktop/git/Helpgitbox (main)

$ git add .

 

kimhy@LAPTOP-9MVGLEHR MINGW64 ~/Desktop/git/Helpgitbox (main)

$ git commit -m 'add f.html in main'

[main 9631ae8] add f.html in main

 1 file changed, 0 insertions(+), 0 deletions(-)

 create mode 100644 f.html

 

kimhy@LAPTOP-9MVGLEHR MINGW64 ~/Desktop/git/Helpgitbox (main)

$ git rebase main

Current branch main is up to date.

 

kimhy@LAPTOP-9MVGLEHR MINGW64 ~/Desktop/git/Helpgitbox (main)

$ git rebase newB

Successfully rebased and updated refs/heads/main.

 

 

2) rebase --onto 

ํŠน์ • ์ž‘์—…๋งŒ ํ–ˆ์„ ๋•Œ ํ•ด๋‹น ์ž‘์—…์„ ๋จผ์ € ์˜ฌ๋ฆด ๋•Œ

 

- ๊ตฌ์กฐ : main - subA - subA-dep1

- ํ•˜๋Š” ๋ฒ• :

$ git rebase --onto main subA subA-dep1

→ ๋ฉ”์ธ์—๋‹ค๊ฐ€ ์„œ๋ธŒ์—์ด ๋ฐ‘์— ์žˆ๋Š” ์„œ๋ธŒ์—์ด๋ށ1์— ์˜ฌ๋ฆด ๊ฒƒ

→ ๊ทธ๋‹ˆ๊นŒ ์„œ๋ธŒ์—์ด๋ށ1 ์€ ๋ฉ”์ธ์— ์˜ฌ๋ผ๊ฐ€ ์žˆ์Œ

 

- ์ฝ”๋”ฉ :

$ git branch

* main

  new

  newB

→ ๋ฉ”์ธ์—์„œ ๋ธŒ๋žœ์น˜ ํ™•์ธ

 

$ git branch -d new

→ ๋ฉ”์ธ์—์„œ new ๋ธŒ๋žœ์น˜ ์‚ญ์ œ

 

$ git switch -c subA

๋ฉ”์ธ์—์„œ subA ๋ธŒ๋žœ์น˜ ๋งŒ๋“ค๊ณ  ์ด๋™

 

kimhy@LAPTOP-9MVGLEHR MINGW64 ~/Desktop/git/Helpgitbox (subA)

$ git add .

subA ์—์„œ subA-1.html ํŒŒ์ผ ์ƒ์„ฑํ•˜๊ณ  subA ๋ธŒ๋žœ์น˜์— add

 

$ git commit -m 'add subA-1.html in subA'

subA ์—์„œ subA-1.html ํŒŒ์ผ commit

 

$ git add .

subA ์—์„œ subA-2.html ํŒŒ์ผ ์ƒ์„ฑํ•˜๊ณ  subA ๋ธŒ๋žœ์น˜์— add

 

$ git commit -m 'add subA-2.html in subA'

subA ์—์„œ commit

 

$ git logstory

subA ์—์„œ ๊ทธ๋ž˜ํ”„ ํ™•์ธ

 

$ git branch subA-dep1

subA ์—์„œ subA-dep1 ๋ธŒ๋žœ์น˜ ์ƒ์„ฑ

 

$ git switch subA-dep1

→ subA-dep1 ๋กœ ์ด๋™

 

$ git add .

subA-dep1 ์—์„œ dep1.html ํŒŒ์ผ ์ƒ์„ฑ ํ›„ add

 

$ git commit -m 'add dep1.html subA-dep1'

→ subA-dep1 ์—์„œ commit

 

$ git switch subA

→ subA-dep1 ์—์„œ subA ๋กœ ์ด๋™

 

$ git swich main

subA ์—์„œ main ์œผ๋กœ ์ด๋™

 

$ git rebase --onto main subA subA-dep1

main ์—์„œ subA ๋ฐ‘์— subA-dep1 ์„ ๋ณ‘ํ•ฉ

!!!!!!!

kimhy@LAPTOP-9MVGLEHR MINGW64 ~/Desktop/git/Helpgitbox (subA-dep1)

$ git merge subA-dep1

Already up to date.

 

kimhy@LAPTOP-9MVGLEHR MINGW64 ~/Desktop/git/Helpgitbox (subA-dep1)

$ git switch main

Switched to branch 'main'

 

kimhy@LAPTOP-9MVGLEHR MINGW64 ~/Desktop/git/Helpgitbox (main)

$ git branch -d subA-dep1

error: The branch 'subA-dep1' is not fully merged.

If you are sure you want to delete it, run 'git branch -D subA-dep1'.

 

kimhy@LAPTOP-9MVGLEHR MINGW64 ~/Desktop/git/Helpgitbox (main)

$ git branch

* main

  newB

  subA

  subA-dep1

 

kimhy@LAPTOP-9MVGLEHR MINGW64 ~/Desktop/git/Helpgitbox (main)

$ git branch -d subA-dep1

error: The branch 'subA-dep1' is not fully merged.

If you are sure you want to delete it, run 'git branch -D subA-dep1'.

 

kimhy@LAPTOP-9MVGLEHR MINGW64 ~/Desktop/git/Helpgitbox (main)

$

 

 

kimhy@LAPTOP-9MVGLEHR MINGW64 ~/Desktop/git/Helpgitbox (main)

$ git branch -D subA-dep1

Deleted branch subA-dep1 (was 4c27b86).

 

kimhy@LAPTOP-9MVGLEHR MINGW64 ~/Desktop/git/Helpgitbox (main)

$ git branch

* main

  newB

  subA

 

kimhy@LAPTOP-9MVGLEHR MINGW64 ~/Desktop/git/Helpgitbox (main)

$ git switch subA

Switched to branch 'subA'

 

 

 

3. ์Šคํ…Œ์‹ฑ Stashing

- ์ž„์‹œ์ €์žฅ : ์ปค๋ฐ‹ ์•ˆํ•˜๊ณ  ๋‚˜๊ฐ€๋ฉด ๋‹ค ๋ฉ”์ธ์œผ๋กœ ์„ธ์ด๋ธŒ ๋˜๋Š”๋ฐ, ์ปค๋ฐ‹์„ ์•ˆํ•˜๊ณ  ๋‚˜๊ฐˆ ์ผ์ด ์žˆ์„ ๋•Œ ์“ฐ๋Š” ๊ฒƒ

- git stash : ์ž„์‹œ ์ €์žฅ์†Œ์— ๋ณด๋‚ด์ฃผ๋Š” ๊ฒƒ

 

- ์ด๋ฆ„๊ณผ ๋ฉ”์‹œ์ง€๋ฅผ ๋„ฃ๊ณ  ์ž„์‹œ ์ €์žฅ์†Œ๋กœ ๋ณด๋‚ด์ฃผ๊ณ  ์‹ถ์œผ๋ฉด :

$ git add .

$ git stash push -m 'subA ing'

→ ์ด๋ ‡๊ฒŒ ํ•˜๋ฉด ์ž„์‹œ์ €์žฅ์†Œ๋กœ html ํŒŒ์ผ์ด ๊ฐ”๊ธฐ ๋•Œ๋ฌธ์— ์•ˆ ๋ณด์ž„

 

$ git stash list

stash@{0}: On subA: subA ing

→ ์ž„์‹œ์ €์žฅ์†Œ ํ™•์ธ, stash ์— subA ๊ฐ€ ๋“ค์–ด๊ฐ”๋‹ค๊ณ  ๋‚˜์˜ด

 

$ git stash push -m 'subA-4 ing'

→ ๋˜ ํ•˜๋‚˜ ์ž„์‹œ์ €์žฅ์†Œ๋กœ ๋ณด๋‚ด๊ณ 

 

$ git stash list

stash@{0}: On subA: subA-4 ing

stash@{1}: On subA: subA ing

→ ํ™•์ธํ•ด๋ณด๋ฉด 0, 1 ๋กœ ๋‚˜์˜ด

 

$ git stash apply stash@{1}

์ž„์‹œ์ €์žฅ์†Œ์— ๋‚จ๊ธฐ๋ฉด์„œ ํŒŒ์ผ ๋ถˆ๋Ÿฌ์˜ค๊ธฐ

 

$ git stash list

stash@{0}: On subA: subA-4 ing

stash@{1}: On subA: subA ing

→ ํ™•์ธํ•ด๋ณด๋ฉด ๋‚จ์•„์žˆ๋Š”๋ฐ subA ์—๋Š” ํŒŒ์ผ ์กด์žฌ

 

$ git stash pop stash@{0}

๋ฆฌ์ŠคํŠธ์—์„œ ์‚ญ์ œํ•˜๋ฉด์„œ ํŒŒ์ผ ๋ถˆ๋Ÿฌ์˜ค๊ธฐ

 

$ git stash list

stash@{0}: On subA: subA ing

 ์‚ญ์ œ๋œ ๊ฒƒ ํ™•์ธ ๊ฐ€๋Šฅ

 

$ git stash drop stash@{0}

์ž„์‹œ์ €์žฅ์†Œ์—์„œ ์‚ญ์ œ, list ๋กœ ํ™•์ธํ•ด๋ณด๋ฉด 0 ๋ฒˆ ํŒŒ์ผ ์‚ญ์ œ๋จ

 

 

4. Story Book ์Šคํ† ๋ฆฌ๋ถ

https://storybook.js.org/tutorials/intro-to-storybook/react/ko/get-started/

- ๋””์ž์ธ ๋žญ๊ท€์ง€(๊ธฐ๋ณธ์ ์ธ ๋ฒ„ํŠผ, ์‹œ์Šคํ…œ ๋ชจ์–‘ ๋“ฑ) ๋ฅผ ์ปดํฌ๋„ŒํŠธํ™”, ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌํ™”