Whatโs git?
- ๊น(Git)์ '๋ถ์ฐ ๋ฒ์ ๊ด๋ฆฌ ์์คํ
(DVCS - Distributed Version Control Systems)'์ผ๋ก, ์ปดํจํฐ ํ์ผ์ ๋ณ๊ฒฝ์ฌํญ์ ์ถ์ ํ๊ณ ์ฌ๋ฌ๋ช
์ ์ฌ์ฉ์๋ค ๊ฐ์ ํ์ผ์ ๋ํ ์์
์ ์กฐ์จํ๋๋ฐ ์ฌ์ฉ๋๋ค.
(์ฐธ๊ณ : https://git-scm.com/book/ko/v2 ๊ณต์ ์ฌ์ดํธ ํ๊ธ ๋ฉ๋ด์ผ).
๊ฐ๋จํ ๊น ๋ช
๋ น์ด
git init # ํ๋ก์ ํธ ํด๋ ์ด๊ธฐํ/์ ์ฅ์ ์์ฑ git add . # ๋ณ๊ฒฝ์ฌํญ ์ ์ฅ git commit -m "๋ฐ์ดํฐ ์ด๋ฆ" # git์ ์ ์ฅํ๊ฒ ๋๋ค. li -a git log # ๋ฐ์ดํฐ ํ์ธ rm - r .git rm - rf .git # ๋ฌป์ง ๋ง๊ณ ์คํ
git add
: Staging Area์ ๋ณ๊ฒฝ ์ฌํญ์ ์ถ๊ฐ (commit ์ค๋น๋จ๊ณ)
git add .
: ํ์ฌ ๋๋ ํ ๋ฆฌ์ ๋ชจ๋ ๋ณ๊ฒฝ ๋ด์ฉ์ Staging Area์ ์ถ๊ฐgit commit
: ๋ณ๊ฒฝ ์์
๋ค์ ์ ์ฅ์์ ์ ์ฅ. (commit ์ ํ๋ฉด ์ฝ๋๋ฅผ ์์ ์ญ์ ํด๋ ๋ค์ ๋์์ฌ ์ ์๋ค.)
commit history ์กฐํํ๊ธฐ
git log # commit history ์กฐํ


user.email / user.name ์ค์
git config --global user.email "UserEmail@mail.com" git config --global user.name "UserName"
GitHub ์ ๋ก๋
git push origin master # ๊นํ๋ธ์ ์ ๋ก๋ git push -f origin master # ๊ฐ์ ๋ฎ์ด์์ฐ๊ธฐ

Ctrl + C : ์งํ์ค์ธ ์์
๋ฉ์ถ๊ธฐ.
Share article