Remote Add ๊ธฐ๋ณธ ๊ฐ๋
git remote add๋ ๋ค์ ํ์์ ๊ฐ์ง๋ค:
git remote add <name> <url>์ฌ๊ธฐ์ <name>์ remote repository์ ๋ํด ์ฐ๋ฆฌ๊ฐ ์ง์ ํ๋ ๋ณ์นญ์ด๋ค.
์ผ๋ฐ์ ์ผ๋ก ์ฌ์ฉ๋๋ Remote ์ด๋ฆ๋ค
-
origin
- ๊ฐ์ฅ ์ผ๋ฐ์ ์ผ๋ก ์ฌ์ฉ๋๋ ์ด๋ฆ
- Convention์ผ ๋ฟ, ๋ค๋ฅธ ์ด๋ฆ ์ฌ์ฉ ๊ฐ๋ฅ
git remote add origin https://github.com/username/repo.git -
upstream
- Forkํ ์๋ณธ repository๋ฅผ ์ง์นญํ ๋ ์ฃผ๋ก ์ฌ์ฉ
- ์ญ์ Convention์ผ ๋ฟ, ๋ค๋ฅธ ์ด๋ฆ ์ฌ์ฉ ๊ฐ๋ฅ
git remote add upstream https://github.com/original/repo.git -
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 ๋ช
๋ น์ด์์ ์ด๋ค ์ด๋ฆ์ด๋ ์ฌ์ฉํ ์ ์๋ค.