์์ ์ github์ justcode ๋ผ๋ repository๋ฅผ ๋ง๋ ๋ค.
๋ด ์ปดํจํฐ์์ practice ํด๋ ๋ฐ์ justcode-test ๋ผ๋ ํด๋๋ฅผ ๋ง๋ ๋ค.
- cd Desktop // cd : ํด๋น ํด๋ ์ง์
- cd practice // cd : ํด๋น ํด๋ ์ง์
- mkdir justcode-test //mkdir : ๋๋ ํ ๋ฆฌ ๋ง๋ค๊ธฐ
justcode-test ํด๋์์ git์ ์ฌ์ฉํ ์ ์๋๋ก ์ด๊ธฐํ ํ๋ค.
- cd justcode-test // cd : ํด๋น ํด๋ ์ง์
- git init // init : git ๋ ํ์งํ ๋ฆฌ ์์ฑ (๊น ์์)
justcode-test ํด๋์ test.js ํ์ผ์ ์์ฑ
: vi test.js ํน์ vscode ์์ test.js ํ์ผ์ ๋ง๋ค์ด์ ๋๋ ํ ๋ฆฌ์ ๋ฃ๊ธฐ
- vi test.js // vi : vi ํธ์ง๊ธฐ ์ด๊ธฐ (ํด๋น ํ์ผ์ด ์์ผ๋ฉด ํ์ผ์ ๋ด์ฉ์ด ๋ณด์ด๊ณ ์๋ ํ์ผ์ด๋ฉด ๋น ํ์ผ์ด ์ด๋ฆฐ๋ค.)
- ํ์ผ ๋ด๋ถ์ i๋ฅผ ๋๋ฅด๋ฉด ์ ๋ ฅํ ์ ์๋ ๋ชจ๋๋ก ๋ฐ๋
- esc ๋๋ฅด๊ณ :wq ์์ฑ ํ enter ํ๋ฉด ํ์ผ ์ ์ฅํ๊ณ ๋น ์ ธ ๋์ด
i (insert) : ์ปค์ ์์ ์
๋ ฅ (ํ์ฌ ์ปค์ ์๋ฆฌ์ ์
๋ ฅ)
a (add) : ์ปค์ ๋ค์ ์
๋ ฅ (ํ์ฌ ์ปค์ ๋ค์ ์๋ฆฌ์ ์
๋ ฅ)
o (open) : ์ปค์๊ฐ ์์นํ ํ์ ๋ค์ํ์ ์
๋ ฅ
I : ์ปค์๊ฐ ์์นํ ํ์ ์ฒซ ์นผ๋ผ์ผ๋ก ์ด๋ํ์ฌ ์
๋ ฅ
A : ์ปค์๊ฐ ์์นํ ํ์ ๋ง์ง๋ง ์นผ๋ผ์ผ๋ก ์ด๋ํ์ฌ ์
๋ ฅ
O : ์ปค์๊ฐ ์์นํ ํ์ ์ด์ ํ์ ์
๋ ฅ
:q : vi ์์ ์์ ํ ๊ฒ์ด ์์ ๋ ๊ทธ๋ฅ ์ข ๋ฃ
:q! : ์์ ํ ๋ด์ฉ์ ์ ์ฅํ์ง ์๊ณ ์ข ๋ฃ(๊ฐ์ ์ข ๋ฃ)
:w [ ํ์ผ๋ช ] : ์์ ํ ๋ด์ฉ์ ์ ์ฅ๋ง ํจ, ํ์ผ๋ช ์ ์ง์ ํ๋ฉด ์ ํ์ผ๋ก ์ ์ฅ๋จ
:wq , :wq! : ์์ ํ ๋ด์ฉ์ ์ ์ฅํ๊ณ , vi ๋ฅผ ์ข ๋ฃ
ZZ : ์์ ํ ๋ด์ฉ์ ์ ์ฅํ๊ณ , vi ๋ฅผ ์ข ๋ฃ
git remote add origin ์ฃผ์ : git push ์ด์ ์ ์์ ํด์ผํจ.(๋ฆฌ๋ชจํธ๊ฐ ๋์ง ์์ผ๋ฉด push ๋ถ๊ฐ)
git add .
git commit -m "Add: ํ์ผ ์์ฑ ๋ฐ ์์ "
git push origin main
------
์ด๋ฏธ ์กด์ฌํ๋ ๋ ํฌ์งํ ๋ฆฌ ๋ณต์ ํด์ ๋ธ๋์น์์ฑํ๊ธฐ
git clone ์ฃผ์
git branch feature/sohee
git checkout feature/sohee
ํด๋ ์์ฑ ๋ฐ ์์ ํ๊ณ
git add .
git commit -m "Add: ํด๋ ์์ฑ ๋ฐ ์์ "
git push origin feature/sohee
pr ํ๊ธฐ
---------
๋๊ตฐ๊ฐ merge๋ฅผ ํ์ ๊ฒฝ์ฐ pull ๋ฐ๊ธฐ
feature/sohee : ํ์ฌ ๋ด ์์น๋ ์ฌ๊ธฐ!
git pull origin main : ์ฌ๊ธฐ์ conflict ๊ฐ ๋จ๋ฉด
-> ์์ ํ๊ณ
git pull origin main : ๋ค์ pull ๋ฐ๊ธฐ (success ๋ฐ๋ ๊น์ง!!!)
-> success๊ฐ ๋๋ฉด
git add .
git commit -m "Add: ํด๋ ์์ฑ ๋ฐ ์์ "
git push origin feature/sohee
pr ํ๊ธฐ
'TIL' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
TIL :: code-kata-js / (5) (0) | 2022.08.19 |
---|---|
TIL :: code-kata-js / (4) (0) | 2022.05.27 |
TIL :: [React] State, Props, Event (0) | 2022.05.26 |
TIL :: [React ] ๋ก๊ทธ์ธ ๋ฒํผ ํ์ฑํ (0) | 2022.05.26 |
TIL :: [React] React Router, Sass (0) | 2022.05.25 |