repository(๋ฆฌํฌ์งํ ๋ฆฌ) : git์์ ์ฝ๋๋ฅผ ์ ์ฅํ๋ ๊ณต๊ฐ
Local Repository(๋ก์ปฌ ๋ฆฌํฌ์งํ ๋ฆฌ)
: ์์ ์ ์ปดํจํฐ์ ์์
๊ณต๊ฐ(local)์ ์์นํ ํ๋ก์ ํธ ์ ์ฅ์ - ๋ด ๊ฐ์ธ ์ ์ฉ ์ ์ฅ์
๋ก์ปฌ ํ๊ฒฝ์ ์๋ ๋๋ ํ ๋ฆฌ์์ Local Repository๋ฅผ ์ถ๊ฐํ๋ฉด ํด๋น ๋๋ ํ ๋ฆฌ์ ํ์ผ ๋ณํ๋ฅผ ๊ฐ์งํ ์ ์๋ค.
git init
: ์์
๊ณต๊ฐ์ local repository ์์ฑ
git add
: Untracked files๋ฅผ Statging area๋ก ์ถ๊ฐํด์ Git์ ๊ด๋ฆฌํ์ ๋๋ค.
Staging area : commit ํ๊ธฐ ์ ์ ๋ด์ฉ์ ๊ธฐ๋กํ๋ ์ฅ์
( git add .
: Statging area์ ๋ชจ๋ ํ์ผ์ ํ๋ฒ์ ์ถ๊ฐํ ์ ์๋ค. )
git staus
: ํ์ผ์ ์ํ ํ์ธ (Statging area๋ก ์ ์ฎ๊ฒจ์ก๋์ง)
- git ๋ฆฌํฌ์งํ ๋ฆฌ๊ฐ ์๋ ๋๋ ํ ๋ฆฌ์์ git status
์
๋ ฅํ๋ฉด ์๋์ ๊ฐ์ ๋ฉ์์ง ์ถ๋ ฅ
git commit
: Staging area์ ์ฝ๋ ๋ฌถ์์ ์ ์ฅํ๊ธฐ๋ก ํ๊ณ , Staging area ์ฝ๋์ ์ฉ๋๋ฅผ ์ ์ด์ฃผ๋ ํ์
git commit -m "commit message"
git status
๋ก Staging area์ ์ํ ํ์ธํ๋ ๊ฒ์ด ์ข์ Remote Repository(์๊ฒฉ ๋ฆฌํฌ์งํ ๋ฆฌ)
: ๋ก์ปฌ์ด ์๋ ์๊ฒฉ ๊ณต๊ฐ์ ์์นํ ํ๋ก์ ํธ ์ ์ฅ์ - ์ฌ๋ฌ ์ฌ๋์ด ํจ๊ป ๊ณต์ ๊ฐ๋ฅ
git remote add
git push
Local์์ ๋ณ๊ฒฝ, ์ปค๋ฐ๋ ์ฌํญ์ Remote Repository์ ์
๋ก๋
์์ ์ ๊นํ๋ธ๋ก ์ด๋ -> ์ํ๋ ๋ฆฌํฌ์งํ ๋ฆฌ ์ด๋ฆ ์
๋ ฅ, Public/Private ์ฒดํฌ ํ Create Repository
git remote
: ์๊ฒฉ ๋ฆฌํฌ์งํ ๋ฆฌ๋ฅผ ๋ค๋ฃจ๊ธฐ ์ํ ๋ช
๋ น์ด
git remote -v
: ์๊ฒฉ ๋ฆฌํฌ์งํ ๋ฆฌ๊ฐ ์ ์ฐ๊ฒฐ๋์๋์ง ํ์ธ
git remote add name URL
: ๋ก์ปฌ ๋ฆฌํฌ์งํ ๋ฆฌ์ ์๊ฒฉ ๋ฆฌํฌ์งํ ๋ฆฌ ์ฃผ์๋ฅผ ๋ฑ๋กํ๋ ๋ช
๋ ์ด
( ์๊ฒฉ ๋ฆฌํฌ์งํ ๋ฆฌ๋ฅผ ํ์
ํ๊ธฐ ์ํด ์ด๋ฆ ์ง์ , ์ด๋ฆ ๋ค์ ์๊ฒฉ ๋ฆฌํฌ์งํ ๋ฆฌ ์ฃผ์ ์์ฑ )
git push
: ๋ก์ปฌ ๋ฆฌํฌ์งํ ๋ฆฌ์ ๊ธฐ๋กํ ๋ด์ญ์ ์๊ฒฉ ๋ฆฌํฌ์งํ ๋ฆฌ๋ก ์ฎ๊ธฐ๋ ์์
git push remote branch
๊ธฐ์กด์ ์ ๋ง๋ค์ด์ง ํ๋ก์ ํธ์ ๋ณํ๋ฅผ ์ฃผ๊ฑฐ๋ ์๋ก์ด ๊ฒ์ ์๋ํด๋ณด๊ธฐ ์ํด ๋ฆฌํฌ์งํ ๋ฆฌ๋ฅผ ๋ณต์ฌํ๋ ๊ฒ
pork ํ ์์ ์ ์ปดํจํฐ์ ๋ก์ปฌ ๋ฆฌํฌ์งํ ๋ฆฌ๋ก git clone
ํด ๋ฐ๋ก ๊ฐ๋ฐํ ์ ์๋ค.
Github ์๊ฒฉ ๋ฆฌํฌ์งํ ๋ฆฌ pork -> ์์ ์ ๊นํ๋ธ ์์ด๋ ์ ํ ํ Create fork -> git clone ์งํ