โ
GIT์ ์ ์จ์?
1. ๋ฒ์ ๊ด๋ฆฌ ๋๊ตฌ: ๋ฒ์ ๋ณ๋ก ๋ธ๋์น๋ฅผ ์ค์ ํ์ฌ, ๋ฒ์ ๊ด๋ฆฌ๊ฐ ์ฌ์์ง๋ค.
2. ํ์ ๋๊ตฌ : ๋ค๋ฅธ ๊ธฐ๋ฅ์ ๊ฐ๋ฐํ๋ฉฐ ์ต์ข ์ ์ผ๋ก ๋์ ๋๋ฃ์ ์ฝ๋๋ฅผ ํฉ์น ์ ์์ผ๋ฉฐ, ๊ฐ๊ฐ ๋ ๋ฆฝ์ ์ผ๋ก ๋ฒ์ ์ ๊ด๋ฆฌํ ์๋ ์๋ค.
3. ๋ถ์ฐ ์์ ๋๊ตฌ: SVN(subversion) ์ค์๊ด๋ฆฌ ๋ฒ์ ๊ด๋ฆฌ ๋๊ตฌ์ ๋๋น๋๋ฉฐ, ์๋ก์ ์์ ์ํ๋ฅผ ์ฝ๊ฒ ๊ณต์ ํ ์ ์๊ณ , ์ฝ๋์ ์ถฉ๋(conflict)๋ ์ฝ๊ฒ ํด๊ฒฐํ ์ ์๋ค.
โโ
GIT์ ๊ตฌ์ฑ
Working directory
- ํ์ฌ ์์ ๊ณต๊ฐ
- Git์ด ๊ด๋ฆฌํ๊ณ ์์ง๋ง, Untracked ์ํ๋ก ๊ตฌ๋ถ
- CTRL+S๋ฅผ ํตํด ํ์ผ์ ์ ์ฅํ๋ค๋ฉด Working directory์ ์ ์ฅ๋ ๊ฒ
Index = Stage = Staging area
- ์๊ฒฉ ์ ์ฅ์๋ก ์ฎ๊ธธ ์ค๋น ๊ณต๊ฐ
- Git์ด ์ถ์ ํ๊ณ ์๋ Tracked์ํ๋ก ๊ตฌ๋ถํ๋ค. ๋ฒ์ ์ผ๋ก ๋ฑ๋ก๋๊ธฐ ์ ์ ์ํ๋ค.
โ
Repository
1) Local repository: PC์ ์๋ ์ ์ฅ์
2) Remote repository: Github์ ๊ฐ์ ์๊ฒฉ์ ์๋ ์ ์ฅ์
โ
โ
GIT ์๋ ์์
- git init: ํ์ฌ ๋๋ ํ ๋ฆฌ์ .git ํด๋๋ฅผ ์์ฑํ๋ค. ๋๋ ํ ๋ฆฌ ํ์์ ํ์ผ๋ค์ ์ถ์ ํ ์ ์์ผ๋ฉฐ, Git๊ณผ ๊ด๋ จ๋ ์์ ์ ํ ์ ์๋ค.
- git add: working directory์ ๋ณ๊ฒฝ๋ ์์ ํ์ผ์ staging area๋ก ์ถ๊ฐ์ํจ๋ค.
- git commit: Staging area์์ Local repository๋ก ํ์ผ์ ๋ณด๋ธ๋ค.
- git push: Local Repository์ ๋ด์ฉ์ Remote Repository๋ก ์ ๋ก๋ํ๋ค.
- git clone, git pull: ์๊ฒฉ์ ์ฅ์์์ ๋ก์ปฌ์ ์ฅ์๋ก ๊ฐ์ ธ์จ๋ค. git clone์ local์ ์๋ฌด๊ฒ๋ ์๋ ์ํ์์ ์๊ฒฉ์ ์ฅ์์ ๋ฐ์ดํฐ๋ฅผ ๊ฐ์ ธ์ค๋ ๊ฒ์ ์๋ฏธํ๋ฉฐ, git pull์ local์ ์ด๋ฏธ ์๊ณ , ์๊ฒฉ์ ์ฅ์์ ์์ ์ํ๋ฅผ ๋ฐ์ํ๊ธฐ ์ํด ํ๋ ๊ฒ์ด๋ค.
โ
โ
โ
Reference
Git ๊ณต์ ๋ฌธ์: https://git-scm.com/book/en/v2
Git ๊ณต์ ๋ฌธ์ (ํ๊ธํ): https://git-scm.com/book/ko/v2โ
'๐ DevOps > ๐ฅ GIT' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
GIT ์๊ฒฉ ์ ์ฅ์ ๋ช ๋ น์ด: branch, merge, checkout, push (0) | 2021.10.13 |
---|---|
[GIT] ๋ค๋ฅธ ์์ด๋ ์ฌ์ฉ์, "remote: Permission to ์๋ฌ" (์๋์ฐ) (0) | 2021.02.14 |
[GIT] ์์ฃผ ๋ฐ์ํ๋ ERROR ๋ชจ์ (0) | 2021.01.28 |
์๋ก์ด ๋ก์ปฌํ๊ฒฝ์์ ์์ ํ ๊ฒฝ์ฐ (0) | 2021.01.26 |
[GIT] ์์ฃผ์ฐ๋ ๊ธฐ๋ณธ์ ์ธ git ๋ช ๋ น์ด ๋ชจ์ (0) | 2021.01.26 |