Remote Add ๊ธฐ๋ณธ ๊ฐœ๋…

git remote add๋Š” ๋‹ค์Œ ํ˜•์‹์„ ๊ฐ€์ง„๋‹ค:

git remote add <name> <url>

์—ฌ๊ธฐ์„œ <name>์€ remote repository์— ๋Œ€ํ•ด ์šฐ๋ฆฌ๊ฐ€ ์ง€์ •ํ•˜๋Š” ๋ณ„์นญ์ด๋‹ค.

์ผ๋ฐ˜์ ์œผ๋กœ ์‚ฌ์šฉ๋˜๋Š” Remote ์ด๋ฆ„๋“ค

  1. origin

    • ๊ฐ€์žฅ ์ผ๋ฐ˜์ ์œผ๋กœ ์‚ฌ์šฉ๋˜๋Š” ์ด๋ฆ„
    • Convention์ผ ๋ฟ, ๋‹ค๋ฅธ ์ด๋ฆ„ ์‚ฌ์šฉ ๊ฐ€๋Šฅ
    git remote add origin https://github.com/username/repo.git
  2. upstream

    • Forkํ•œ ์›๋ณธ repository๋ฅผ ์ง€์นญํ•  ๋•Œ ์ฃผ๋กœ ์‚ฌ์šฉ
    • ์—ญ์‹œ Convention์ผ ๋ฟ, ๋‹ค๋ฅธ ์ด๋ฆ„ ์‚ฌ์šฉ ๊ฐ€๋Šฅ
    git remote add upstream https://github.com/original/repo.git
  3. custom name

    • ์–ด๋–ค ์ด๋ฆ„์ด๋“  ์‚ฌ์šฉ ๊ฐ€๋Šฅ
    git remote add myrepo https://github.com/username/repo.git
    git remote add backup https://github.com/username/backup.git
    git remote add ci https://github.com/username/repo.git

Remote ๊ด€๋ จ ์ฃผ์š” ๋ช…๋ น์–ด

# Remote ๋ชฉ๋ก ํ™•์ธ
git remote
 
# Remote ์ƒ์„ธ ์ •๋ณด ํ™•์ธ
git remote -v
 
# Remote ์ถ”๊ฐ€
git remote add <name> <url>
 
# Remote URL ๋ณ€๊ฒฝ
git remote set-url <name> <new-url>
 
# Remote ์ œ๊ฑฐ
git remote remove <name>
 
# Remote ์ด๋ฆ„ ๋ณ€๊ฒฝ
git remote rename <old-name> <new-name>

์‹ค์ œ ์‚ฌ์šฉ ์˜ˆ์‹œ

# ์—ฌ๋Ÿฌ ๊ฐœ์˜ remote ์ถ”๊ฐ€
git remote add origin https://github.com/username/repo.git
git remote add backup https://github.com/username/backup.git
git remote add testing https://github.com/username/testing.git
 
# ๊ฒฐ๊ณผ ํ™•์ธ
git remote -v
origin  https://github.com/username/repo.git (fetch)
origin  https://github.com/username/repo.git (push)
backup  https://github.com/username/backup.git (fetch)
backup  https://github.com/username/backup.git (push)
testing https://github.com/username/testing.git (fetch)
testing https://github.com/username/testing.git (push)

์ฆ‰, origin, upstream, ci ๋“ฑ์€ ๋‹จ์ˆœํžˆ ๊ด€๋ก€์ ์œผ๋กœ ์‚ฌ์šฉ๋˜๋Š” ์ด๋ฆ„์ผ ๋ฟ, git remote add ๋ช…๋ น์–ด์—์„œ ์–ด๋–ค ์ด๋ฆ„์ด๋“  ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋‹ค.