β’
μ격μ μ₯μ
λ‘컬μ μ₯μ
β’
λ‘컬μ μ₯μ
μ격μ μ₯μ
μ격μ μ₯μ
λ‘컬μ μ₯μ
Git Clone
μ격 μ μ₯μμ μλ Git μ μ₯μλ₯Ό 볡μ νμ¬ λ‘컬 μ μ₯μλ‘ κ°μ Έμ€λ λͺ
λ Ήμ΄
1.
Github μ격 μ μ₯μ μ μ
2.
μ격 μ μ₯μ URL 볡μ¬
3.
git clone
Github μ격 μ μ₯μ μ μ
μ격 μ μ₯μ URL 볡μ¬
git clone
git clone [μ격μ μ₯μ URL]
Bash
볡μ¬
git clone https://github.com/username/repository.git
Bash
볡μ¬
λ‘컬μ μ₯μ
μ격μ μ₯μ
1.
git init
2.
git remote
Git init
μλ‘μ΄ μ μ₯μ μμ±νλ λͺ
λ Ήμ΄
git init λͺ
λ Ήμ΄λ₯Ό μ€ννλ©΄ Gitμ νμ¬ λλ ν 리μ .git μ΄λΌλ μ¨κ²¨μ§ λλ ν 리λ₯Ό μμ±ν©λλ€. μ΄ λλ ν 리μλ Git μ μ₯μμ νμν λͺ¨λ μ€μ κ³Ό λ©νλ°μ΄ν°κ° μ μ₯λ©λλ€.
git init
Bash
볡μ¬
Git Remote
μ격 μ μ₯μλ₯Ό κ΄λ¦¬νλ λͺ
λ Ήμ΄
λͺ
λ Ήμ΄ | μ€λͺ
| μμ μ½λ |
git remote add | μ격 μ μ₯μλ₯Ό μΆκ° | git remote add <μ격 μ μ₯μ μ΄λ¦> <URL> |
git remote rename | μ격 μ μ₯μμ μ΄λ¦μ λ³κ²½ | git remote rename <νμ¬ μ΄λ¦> <μλ‘μ΄ μ΄λ¦> |
git remote remove | μ격 μ μ₯μλ₯Ό μ κ±° | git remote remove <μ격 μ μ₯μ μ΄λ¦> |
git remote add
git remote add origin https://github.com/user/repo.git
Bash
볡μ¬
μ격 μ μ₯μμ URLμ μ§μ νμ¬ ν΄λΉ μ μ₯μλ₯Ό 'origin'μ΄λΌλ μ΄λ¦μΌλ‘ μΆκ°ν©λλ€.
git remote rename
git remote rename origin main_origin
Bash
볡μ¬
νμ¬ μ΄λ¦μ΄ 'origin'μΈ μ격 μ μ₯μλ₯Ό 'main_origin'μ΄λΌλ μ΄λ¦μΌλ‘ λ³κ²½ν©λλ€.
git remote remove
git remote remove main_origin
Bash
볡μ¬
'main_origin'μ΄λΌλ μ΄λ¦μ μ격 μ μ₯μλ₯Ό μ κ±°ν©λλ€.
λ‘컬μ μ₯μ
μ격μ μ₯μ μ€μ΅νκΈ°
1.
git init
2.
git remote add [repository URL]
3.
git fetch
4.
μλ‘μ΄ νμΌ μμ±
5.
git add .
6.
git commit -m λ©μμ§
7.
git branch
8.
git merge
9.
git push
git init
git init
Bash
볡μ¬
git remote add [repository URL]
git remote add origin https://github.com/ALOHA-CLASS/λ ν¬μ§ν 리μ΄λ¦
Bash
볡μ¬
μΆκ° μ€λͺ
git fetch
git fetch
Bash
볡μ¬
μλ‘μ΄ νμΌ μμ±
TEST.md νμΌ μμ±
git status
git status
Bash
볡μ¬
Git μνλ₯Ό μΆλ ₯νλ€.
git add .
git add .
Bash
볡μ¬
λͺ¨λ λ³κ²½ μ¬νμ μ€ν
μ΄μ§ν©λλ€.
git commit -m λ©μμ§
git commit -m μ΅μ΄μ»€λ°
Bash
볡μ¬
μ€ν
μ΄μ§μ μΆκ°λ λ³κ²½ μ¬νμ μ μ₯μμ μ μ©μν΅λλ€.
git branch
git branch --set-upstream-to=origin/main main
Bash
볡μ¬
β’
λ‘컬 μ μ₯μμ main λΈλμΉμμ μ
λ‘λ ν λ, μ°κ²°ν μ격 μ μ₯μμ λΈλμΉλ₯Ό orgin/main μΌλ‘ μ€μ
git merge
git merge --allow-unrelated-histories origin/main
Bash
볡μ¬
git push
git push
Bash
볡μ¬
μ격μ μ₯μμμ μ νμΌ μΆκ°
git pull
git pull
Bash
볡μ¬






