์์ํ๊ธฐ ์ ์ ๋ค์์ ์๊ณ ์์ด์ผ ํฉ๋๋ค.
- GitHub ์ฌ์ฉ์ ์ด๋ฆ
- ์ธ๋ถ ๋ฆฌํฌ์งํ ๋ฆฌ์ ๋ณต์ URL(์:
https://external-host.com/user/repo.git
๋๋git://external-host.com/user/repo.git
)(external-host.com
๋๋ฉ์ธ ์ด๋ฆ ์์user@
ํฌํจ)
์ฐธ๊ณ ํญ๋ชฉ
๋ฐ๋ชจ๋ฅผ ์ํด ๋ค์์ ์ฌ์ฉํฉ๋๋ค.
- ์ธ๋ถ ๊ณ์ (extuser)
- ์ธ๋ถ Git ํธ์คํธ(
https://external-host.com
) - GitHub ๊ฐ์ธ ๊ณ์ (ghuser)
- GitHub.com์ repo.git๋ผ๋ ์ด๋ฆ์ ๋ฆฌํฌ์งํ ๋ฆฌ
-
GitHub์ ์ ๋ฆฌํฌ์งํ ๋ฆฌ๋ฅผ ๋ง๋ญ๋๋ค. ์ธ๋ถ Git ๋ฆฌํฌ์งํ ๋ฆฌ๋ฅผ ์ ๋ฆฌํฌ์งํ ๋ฆฌ๋ก ๊ฐ์ ธ์ต๋๋ค.
-
๋ช ๋ น์ค์์ ์ธ๋ถ ๋ณต์ URL์ ์ฌ์ฉํ์ฌ ์ธ๋ถ ๋ฆฌํฌ์งํ ๋ฆฌ์ "์ต์" ๋ณต์ ๋ณธ์ ๋ง๋ญ๋๋ค. ์ด๋ ๊ฒ ํ๋ฉด ํ์ผ ํธ์ง์ ์ํ ์์ ๋๋ ํฐ๋ฆฌ ์์ด ๋ฐ์ดํฐ์ ์ ์ฒด ๋ณต์ฌ๋ณธ์ด ์์ฑ๋๋ฉฐ, ๋ชจ๋ ์ด์ ๋ฐ์ดํฐ๋ฅผ ์๋ก ๋ด๋ณด๋ ๋๋ค.
$ git clone --bare https://external-host.com/EXTUSER/REPO.git # Makes a bare clone of the external repository in a local directory
-
โ๋ฏธ๋ฌโ ์ต์ ์ ์ฌ์ฉํ์ฌ ๋ก์ปฌ๋ก ๋ณต์ ๋ ๋ฆฌํฌ์งํ ๋ฆฌ๋ฅผ GitHub์ ํธ์ํฉ๋๋ค. ๊ทธ๋ฌ๋ฉด ๋ถ๊ธฐ ๋ฐ ํ๊ทธ์ ๊ฐ์ ๋ชจ๋ ์ฐธ์กฐ๊ฐ ๊ฐ์ ธ์จ ๋ฆฌํฌ์งํ ๋ฆฌ์ ๋ณต์ฌ๋ฉ๋๋ค.
$ cd REPO.git $ git push --mirror https://github.com/USER/REPO.git # Pushes the mirror to the new repository on GitHub.com
-
์์ ๋ก์ปฌ ๋ฆฌํฌ์งํ ๋ฆฌ๋ฅผ ์ ๊ฑฐํฉ๋๋ค.
cd .. rm -rf REPO.git
๊ฐ์ ธ์ค๋ ๋ฆฌํฌ์งํ ๋ฆฌ์ ๋์ฉ๋ ํ์ผ์ด ํฌํจ๋์ด ์์ผ๋ฉด ๊ฒฝ๊ณ ๋๋ ์ค๋ฅ๊ฐ ๋ฐ์ํ ์ ์์ต๋๋ค. ๋์ฉ๋ ํ์ผ๊ณผ ๊ด๋ฆฌ ๋ฐฉ๋ฒ์ ๋ํ ์์ธํ ๋ด์ฉ์ GitHub์ ๋์ฉ๋ ํ์ผ ์ ๋ณด์(๋ฅผ) ์ฐธ์กฐํ์ธ์.