Skip to content

Latest commit

Β 

History

History
27 lines (18 loc) Β· 1.84 KB

github_upstream.md

File metadata and controls

27 lines (18 loc) Β· 1.84 KB

βœ…[Git/Github] Upstream, Origin, Local repository

image (μ΄λ―Έμ§€μΆœμ²˜)

1. Local repository & Remote repository

  • Local repository
    • 생성방법
      • (1) local ν™˜κ²½μ—μ„œ ν”„λ‘œμ νŠΈ μ§„ν–‰ν•˜λ €λŠ” empty repository 에 μ§„μž…ν•œ λ‹€μŒ git init
      • (2) Github μ—μ„œ μƒμ„±ν•œ repository λ₯Ό git clone
  • Remote repository
    • remote λŠ” Github 에 μ‘΄μž¬ν•˜κ³  μžˆλŠ” repository λ₯Ό μ§€μΉ­ν•˜λ©°, origin 은 remote repository 에 뢙인 μ΄λ¦„μž„

      "'origin' 도 git clone λͺ…령이 μžλ™μœΌλ‘œ λ§Œλ“€μ–΄μ£ΌλŠ” 리λͺ¨νŠΈ 이름이닀. git clone -o booyah 라고 μ˜΅μ…˜μ„ μ£Όκ³  λͺ…령을 μ‹€ν–‰ν•˜λ©΄ booyah/master 라고 μ‚¬μš©μžκ°€ μ •ν•œ λŒ€λ‘œ 리λͺ¨νŠΈ 이름을 생성해쀀닀." (link)

    • local κ³Ό remote μž‘μ—… 내역을 μ„œλ‘œ 반영(동기화)ν•˜κΈ° μœ„ν•΄ git push (local μ—μ„œ remote 둜), git pull (remote μ—μ„œ local 둜)

    • 생성방법

      • (1) local μ—μ„œ 직접 git init ν•œ 경우, git remote -v λͺ…λ Ήμ–΄λ‘œ remote 섀정을 ν™•μΈν•œ λ‹€μŒ git remote add origin https://github.com/κΉƒν—™μœ μ €λ„€μž„/μ €μž₯μ†Œμ΄λ¦„.git 으둜 Github 에 μƒμ„±ν•œ remote repository λ₯Ό μ—°κ²°
      • (2) 이미 init ν•˜μ—¬ ν˜•μƒκ΄€λ¦¬ 되고 있던 repository λ₯Ό Github μ—μ„œ git clone 받은 경우, origin 섀정도 λ˜μ–΄ μžˆλŠ” μƒνƒœ

2. Upstream repository & Downstream repository

  • Upstream repository
  • Downstream repository