์์ค์ฝ๋ ๊ด๋ฆฌ๋ฅผ ์ํ ํ๋ก๊ทธ๋จ์ผ๋ก git์ ์ฌ์ฉํ๋ฏ๋ก ๋ฐฐ์ฐ๋ ค๊ณ ํ๋๋ฐ ๋๋ฌด ์ด๋ ค์ ๋ค. ๐คง
๋๋ ๋ฐ๋ณด์ธ๊ฐ๋ด...๐คฏ
git
์ ๋ถ์ฐํ ๊ด๋ฆฌ ์์คํ
( Distributed Version Control Systems ; DVCS)์ผ๋ก ๋์์ ๋ค์ํ ๊ทธ๋ฃน๊ณผ ํ์
์ ํ ๋, local pc์์ ๋
๋ฆฝ์ ์ผ๋ก ๊ฐ๋ฐํ๊ณ ๋ณ๊ฒฝ ์ฌํญ์ ์ค์ ์๋ฒ์ ๋ณํฉํ์ฌ ์ ์ฐํ๊ฒ ๋ฒ์ ๊ด๋ฆฌ๋ฅผ ํ ์ ์๋ ์์คํ
์
๋๋ค.
1) Working Directory (์์ ์์ญ)
์ค์ ํ๋ก์ ํธ ๋๋ ํ ๋ฆฌ
.git ์ด๋ ฅ๊ณผ ๊ด๋ จ ์ ๋ณด๊ฐ ์ ์ฅ ๋ .git์ ์ ์ธํ ๋ชจ๋ ์์ญ
์ค์ ์ฝ๋์ ์ถ๊ฐ, ์์ , ์ญ์ ์์ ์ด ์ด๋ฃจ์ด์ง๋ ์์ญ
2) Staging Area
Working Directory์์ Repository๋ก ์ ๋ณด ์ ์ฅ ์ ์ค๋น ์์ญ
ํ์ผ ์ํ๋ฅผ ๊ธฐ๋ก, ์คํ ์ด์ง ํ๋ค๊ณ ํํ ํ๋ค.
.git/index ํ์ผ๋ก ๊ด๋ฆฌ๋๋ค.
3.1) git add : Working Directory ์์ staging ์์ญ์ผ๋ก ์ ๋ณด๊ฐ ์ ์ฅ๋จ.
3.2) git commit : staging์์ญ์์ Repository๋ก ์ ๋ณด๊ฐ ์ ์ฅ๋จ.
3) Local Repository (๋ก์ปฌ ์ ์ฅ์)
ํ์ผ, ํด๋๋ฅผ ๋ณ๊ฒฝ ์ด๋ ฅ๋ณ๋ก ์ ์ฅํด ๋๋ ๊ณณ
๊ฐ์ธ PC์ ํ์ผ์ด ์ ์ฅ๋๋ ๊ฐ์ธ ์ ์ฅ์
4) Remote Repository(์๊ฒฉ ์ ์ฅ์)
git init : git ์ด๊ธฐํ ํ ์์ฑ
git clone github_์ฃผ์ : ํด๋ก ๋ง๋ค๊ธฐ
git checkout branch_name : ๋ธ๋์น ๋จธ๋ฌด๋ฅด๊ธฐ(์ ํํ๊ธฐ)
git branch branch_name : ๋ธ๋์น ๋ง๋ค๊ธฐ
git branch -r : remote branch(์๊ฒฉ ๋ธ๋์น) ํ์ธ
git branch -a : local branch(๋ก์ปฌ ๋ธ๋์น) ๋ชฉ๋ก ํ์ธ
git add . : ํ์ฌ ๋๋ ํ ๋ฆฌ ์์ ์ฝ๋ ์ ํํ๊ธฐ
git commit -m "message" : ์ ํํ ์ฝ๋ ๋ฉ์ธ์ง(์ค๋ช ) ์ ๊ธฐ
git push "remote_branch" "branch_name" : addํ๊ณ commit ํ ํ์ github ์ ๋ณด๋ด๊ธฐ
git pull : remote_repo์์ mergeํ ์ต์ ์ฝ๋๋ฅผ local์ ๊ฐ์ ธ์ mergeํ๊ธฐ
git log : log ๊ธฐ๋ก ํ์ธ
git status : ๋ธ๋์น์ ๋ณ๊ฒฝ์ฌํญ ์๋ด
์ฐธ๊ณ ์๋ฃ
https://goddaehee.tistory.com/217?category=381481
https://backlog.com/git-tutorial/kr/stepup/stepup2_3.html
https://wayhome25.github.io/git/2017/07/08/git-first-pull-request-story/