{"meta":{"title":"리포지토리 복제","intro":"GitHub에서 리포지토리를 생성하면 원격 리포지토리로 생성됩니다. 리포지토리를 복제하여 컴퓨터에 로컬 복사본을 만들고 두 위치 간에 동기화할 수 있습니다.","product":"리포지토리","breadcrumbs":[{"href":"/ko/repositories","title":"리포지토리"},{"href":"/ko/repositories/creating-and-managing-repositories","title":"리포지토리 만들기 및 관리"},{"href":"/ko/repositories/creating-and-managing-repositories/cloning-a-repository","title":"리포지토리 복제"}],"documentType":"article"},"body":"# 리포지토리 복제\n\nGitHub에서 리포지토리를 생성하면 원격 리포지토리로 생성됩니다. 리포지토리를 복제하여 컴퓨터에 로컬 복사본을 만들고 두 위치 간에 동기화할 수 있습니다.\n\n## 리포지토리 복제에 관한 정보\n\n<div class=\"ghd-tool webui\">\n\n리포지 GitHub.com 토리를 로컬 컴퓨터 또는 코드스페이스\n로 복제하여 병합 충돌을 보다 쉽게 해결하고, 파일을 추가 또는 제거하고, 더 큰 커밋을 푸시할 수 있습니다. 리포지토리를 복제하면 리포지토리를 GitHub.com에서 로컬 컴퓨터로 복사하거나, 코드스페이스를 만들 때 원격 가상 머신으로 복사합니다. 코드스페이스로 복제하는 방법에 대한 자세한 내용은 [리포지토리에 대한 codespace 만들기](/ko/codespaces/developing-in-a-codespace/creating-a-codespace-for-a-repository)을 참조하세요\n\n</div>\n\n<div class=\"ghd-tool cli\">\n\nGitHub.com에서 로컬 컴퓨터로 리포지토리를 복제하여 병합 충돌을 보다 쉽게 해결하고, 파일을 추가 또는 제거하고, 더 큰 커밋을 푸시할 수 있습니다. 리포지토리를 복제할 때 GitHub.com에서 로컬 컴퓨터로 리포지토리를 복사합니다.\n\n</div>\n\n<div class=\"ghd-tool desktop\">\n\nGitHub.com에서 로컬 컴퓨터로 리포지토리를 복제하여 병합 충돌을 보다 쉽게 해결하고, 파일을 추가 또는 제거하고, 더 큰 커밋을 푸시할 수 있습니다. 리포지토리를 복제할 때 GitHub.com에서 로컬 컴퓨터로 리포지토리를 복사합니다.\n\n</div>\n\n리포지토리를 복제하면 프로젝트에 대한 모든 파일 및 폴더의 모든 버전을 포함하여 해당 시점에 있는 GitHub.com 모든 리포지토리 데이터의 전체 복사본이 제거됩니다.\nGitHub.com의 원격 리포지토리로 변경 내용을 푸시하거나, GitHub.com에서 다른 사람의 변경 내용을 가져올 수 있습니다. 자세한 내용은 [Git 사용](/ko/get-started/using-git)을(를) 참조하세요.\n\n기존 리포지토리를 복제하거나 다른 사람의 기존 리포지토리를 복제하여 프로젝트에 기여할 수 있습니다.\n\n## 리포지토리 복제\n\n<div class=\"ghd-tool webui\">\n\n1. GitHub에서 리포지토리의 기본 페이지로 이동합니다.\n\n2. 파일 목록 위에서 **<svg version=\"1.1\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" class=\"octicon octicon-code\" aria-label=\"code\" role=\"img\"><path d=\"m11.28 3.22 4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.749.749 0 0 1-1.275-.326.749.749 0 0 1 .215-.734L13.94 8l-3.72-3.72a.749.749 0 0 1 .326-1.275.749.749 0 0 1 .734.215Zm-6.56 0a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042L2.06 8l3.72 3.72a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L.47 8.53a.75.75 0 0 1 0-1.06Z\"></path></svg> 코드**를 클릭합니다.\n\n   ![리포지토리의 방문 페이지에 있는 파일 목록의 스크린샷. \"코드\" 단추는 진한 주황색 윤곽선으로 강조 표시됩니다.](/assets/images/help/repository/code-button.png)\n\n3. 리포지토리의 URL을 복사합니다.\n\n   * HTTPS를 사용하여 리포지토리를 복제하려면 \"HTTPS\"에서 <svg version=\"1.1\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" class=\"octicon octicon-copy\" aria-label=\"copy icon\" role=\"img\"><path d=\"M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 0 1 0 1.5h-1.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-1.5a.75.75 0 0 1 1.5 0v1.5A1.75 1.75 0 0 1 9.25 16h-7.5A1.75 1.75 0 0 1 0 14.25Z\"></path><path d=\"M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0 1 14.25 11h-7.5A1.75 1.75 0 0 1 5 9.25Zm1.75-.25a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Z\"></path></svg>를 클릭합니다.\n   * 조직의 SSH 인증 기관에서 발급한 인증서를 포함하여 SSH 키를 사용하여 리포지토리를 복제하려면 **SSH**를 클릭한 다음, <svg version=\"1.1\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" class=\"octicon octicon-copy\" aria-label=\"Copy to clipboard\" role=\"img\"><path d=\"M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 0 1 0 1.5h-1.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-1.5a.75.75 0 0 1 1.5 0v1.5A1.75 1.75 0 0 1 9.25 16h-7.5A1.75 1.75 0 0 1 0 14.25Z\"></path><path d=\"M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0 1 14.25 11h-7.5A1.75 1.75 0 0 1 5 9.25Zm1.75-.25a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Z\"></path></svg>를 클릭합니다.\n   * GitHub CLI를 사용하여 리포지토리를 복제하려면 **GitHub CLI** 를 클릭한 다음, <svg version=\"1.1\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" class=\"octicon octicon-copy\" aria-label=\"Copy to clipboard\" role=\"img\"><path d=\"M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 0 1 0 1.5h-1.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-1.5a.75.75 0 0 1 1.5 0v1.5A1.75 1.75 0 0 1 9.25 16h-7.5A1.75 1.75 0 0 1 0 14.25Z\"></path><path d=\"M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0 1 14.25 11h-7.5A1.75 1.75 0 0 1 5 9.25Zm1.75-.25a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Z\"></path></svg>을 클릭합니다.\n\n     ![\"코드\" 드롭다운 메뉴의 스크린샷. 리포지토리의 HTTPS URL 오른쪽에 복사 아이콘이 진한 주황색으로 표시됩니다.](/assets/images/help/repository/https-url-clone-cli.png)\n\n4. <span class=\"platform-mac\">터미널</span><span class=\"platform-linux\">터미널</span><span class=\"platform-windows\">Git Bash</span>를 엽니다.\n\n5. 현재 작업 디렉터리를 복제 대상 디렉터리의 위치로 변경합니다.\n\n6. `git clone`을 입력한 다음 이전에 복사한 URL을 붙여넣습니다.\n\n   ```shell\n   git clone https://github.com/YOUR-USERNAME/YOUR-REPOSITORY\n   ```\n\n7. **Enter** 키를 눌러 로컬 복제본을 만듭니다.\n\n   ```shell\n   $ git clone https://github.com/YOUR-USERNAME/YOUR-REPOSITORY\n   > Cloning into `Spoon-Knife`...\n   > remote: Counting objects: 10, done.\n   > remote: Compressing objects: 100% (8/8), done.\n   > remove: Total 10 (delta 1), reused 10 (delta 1)\n   > Unpacking objects: 100% (10/10), done.\n   ```\n\n</div>\n\n<div class=\"ghd-tool cli\">\n\n> \\[!NOTE]\n> GitHub CLI에 대한 자세한 내용은 [GitHub CLI 정보](/ko/github-cli/github-cli/about-github-cli)을(를) 참조하세요.\n\n리포지토리를 로컬로 복제하려면 `repo clone` 하위 명령을 사용합니다.\n`repository` 매개 변수를 리포지토리 이름으로 바꿉니다. 예를 들어 `octo-org/octo-repo`, `monalisa/octo-repo` 또는 `octo-repo`입니다.\n`OWNER/` 리포지토리 인수의 `OWNER/REPO` 부분을 생략하면 기본값은 인증 사용자의 이름으로 설정됩니다.\n\n```shell\ngh repo clone REPOSITORY\n```\n\nGitHub URL을 사용하여 리포지토리를 복제할 수도 있습니다.\n\n```shell\ngh repo clone https://github.com/PATH-TO/REPOSITORY\n```\n\n</div>\n\n<div class=\"ghd-tool desktop\">\n\n1. GitHub에서 리포지토리의 기본 페이지로 이동합니다.\n2. 파일 목록 위에서 **<svg version=\"1.1\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" class=\"octicon octicon-code\" aria-label=\"code\" role=\"img\"><path d=\"m11.28 3.22 4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.749.749 0 0 1-1.275-.326.749.749 0 0 1 .215-.734L13.94 8l-3.72-3.72a.749.749 0 0 1 .326-1.275.749.749 0 0 1 .734.215Zm-6.56 0a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042L2.06 8l3.72 3.72a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L.47 8.53a.75.75 0 0 1 0-1.06Z\"></path></svg> 코드**를 클릭합니다.\n\n   ![리포지토리의 방문 페이지에 있는 파일 목록의 스크린샷. \"코드\" 단추가 진한 주황색 윤곽선으로 강조 표시되어 있습니다.](/assets/images/help/repository/code-button.png)\n3. GitHub Desktop을 사용하여 리포지토리를 복제하고 열려면 **<svg version=\"1.1\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" class=\"octicon octicon-desktop-download\" aria-label=\"desktop-download\" role=\"img\"><path d=\"m4.927 5.427 2.896 2.896a.25.25 0 0 0 .354 0l2.896-2.896A.25.25 0 0 0 10.896 5H8.75V.75a.75.75 0 1 0-1.5 0V5H5.104a.25.25 0 0 0-.177.427Z\"></path><path d=\"M1.573 2.573a.25.25 0 0 0-.073.177v7.5a.25.25 0 0 0 .25.25h12.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25h-3a.75.75 0 1 1 0-1.5h3A1.75 1.75 0 0 1 16 2.75v7.5A1.75 1.75 0 0 1 14.25 12h-3.727c.099 1.041.52 1.872 1.292 2.757A.75.75 0 0 1 11.25 16h-6.5a.75.75 0 0 1-.565-1.243c.772-.885 1.192-1.716 1.292-2.757H1.75A1.75 1.75 0 0 1 0 10.25v-7.5A1.75 1.75 0 0 1 1.75 1h3a.75.75 0 0 1 0 1.5h-3a.25.25 0 0 0-.177.073ZM6.982 12a5.72 5.72 0 0 1-.765 2.5h3.566a5.72 5.72 0 0 1-.765-2.5H6.982Z\"></path></svg> Open with GitHub Desktop** 을 클릭합니다.\n\n   ![리포지토리의 “코드” 드롭다운 스크린샷 \"GitHub Desktop으로 열기\"라는 레이블이 있는 단추가 진한 주황색 윤곽선으로 표시되어 있습니다.](/assets/images/help/repository/open-with-desktop.png)\n4. GitHub Desktop의 안내에 따라 복제를 완료하세요.\n\n자세한 내용은 [GitHub에서 GitHub Desktop으로 리포지토리 복제](/ko/desktop/adding-and-cloning-repositories/cloning-a-repository-from-github-to-github-desktop)을(를) 참조하세요.\n\n</div>\n\n## 빈 리포지토리 복제\n\n빈 리포지토리에는 파일이 없습니다. 리포지토리를 만들 때 추가 정보로 리포지토리를 초기화하지 않는 경우가 많습니다.\n\n1. GitHub에서 리포지토리의 기본 페이지로 이동합니다.\n\n2. HTTPS를 사용하여 명령줄을 사용하여 리포지토리를 복제하려면 \"빠른 설정\"에서 을 클릭합니다 <svg version=\"1.1\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" class=\"octicon octicon-copy\" aria-label=\"Copy to clipboard\" role=\"img\"><path d=\"M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 0 1 0 1.5h-1.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-1.5a.75.75 0 0 1 1.5 0v1.5A1.75 1.75 0 0 1 9.25 16h-7.5A1.75 1.75 0 0 1 0 14.25Z\"></path><path d=\"M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0 1 14.25 11h-7.5A1.75 1.75 0 0 1 5 9.25Zm1.75-.25a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Z\"></path></svg>. 조직의 SSH 인증 기관에서 발급한 인증서를 포함하여 SSH 키를 사용하여 리포지토리를 복제하려면 **SSH**를 클릭한 다음 클릭합니다 <svg version=\"1.1\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" class=\"octicon octicon-copy\" aria-label=\"Copy to clipboard\" role=\"img\"><path d=\"M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 0 1 0 1.5h-1.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-1.5a.75.75 0 0 1 1.5 0v1.5A1.75 1.75 0 0 1 9.25 16h-7.5A1.75 1.75 0 0 1 0 14.25Z\"></path><path d=\"M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0 1 14.25 11h-7.5A1.75 1.75 0 0 1 5 9.25Zm1.75-.25a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Z\"></path></svg>.\n\n   ![빈 리포지토리에 대한 빠른 설정 노트의 스크린샷 리포지토리의 HTTPS URL 오른쪽에 복사 아이콘이 주황색 윤곽선으로 표시되어 있습니다.](/assets/images/help/repository/empty-https-url-clone-button.png)\n\n   또는 데스크톱에서 리포지토리를 복제하려면 **데스크톱에서 설정을 클릭하고<svg version=\"1.1\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" class=\"octicon octicon-desktop-download\" aria-label=\"desktop-download\" role=\"img\"><path d=\"m4.927 5.427 2.896 2.896a.25.25 0 0 0 .354 0l2.896-2.896A.25.25 0 0 0 10.896 5H8.75V.75a.75.75 0 1 0-1.5 0V5H5.104a.25.25 0 0 0-.177.427Z\"></path><path d=\"M1.573 2.573a.25.25 0 0 0-.073.177v7.5a.25.25 0 0 0 .25.25h12.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25h-3a.75.75 0 1 1 0-1.5h3A1.75 1.75 0 0 1 16 2.75v7.5A1.75 1.75 0 0 1 14.25 12h-3.727c.099 1.041.52 1.872 1.292 2.757A.75.75 0 0 1 11.25 16h-6.5a.75.75 0 0 1-.565-1.243c.772-.885 1.192-1.716 1.292-2.757H1.75A1.75 1.75 0 0 1 0 10.25v-7.5A1.75 1.75 0 0 1 1.75 1h3a.75.75 0 0 1 0 1.5h-3a.25.25 0 0 0-.177.073ZM6.982 12a5.72 5.72 0 0 1-.765 2.5h3.566a5.72 5.72 0 0 1-.765-2.5H6.982Z\"></path></svg>** 프롬프트에 따라 복제를 완료합니다.\n\n   ![빈 리포지토리에 대한 빠른 설정 노트의 스크린샷 “바탕 화면에서 설정” 단추는 진한 주황색으로 표시됩니다.](/assets/images/help/repository/empty-desktop-clone-button.png)\n\n3. <span class=\"platform-mac\">터미널</span><span class=\"platform-linux\">터미널</span><span class=\"platform-windows\">Git Bash</span>를 엽니다.\n\n4. 현재 작업 디렉터리를 복제 대상 디렉터리의 위치로 변경합니다.\n\n5. `git clone`을 입력한 다음 이전에 복사한 URL을 붙여넣습니다.\n\n   ```shell\n   git clone https://github.com/YOUR-USERNAME/YOUR-REPOSITORY\n   ```\n\n6. **Enter** 키를 눌러 로컬 복제본을 만듭니다.\n\n   ```shell\n   $ git clone https://github.com/YOUR-USERNAME/YOUR-REPOSITORY\n   > Cloning into `Spoon-Knife`...\n   > remote: Counting objects: 10, done.\n   > remote: Compressing objects: 100% (8/8), done.\n   > remove: Total 10 (delta 1), reused 10 (delta 1)\n   > Unpacking objects: 100% (10/10), done.\n   ```\n\n## 복제 오류 문제 해결\n\n리포지토리를 복제할 때 몇 가지 오류가 발생할 수 있습니다.\n\n리포지토리를 복제할 수 없는 경우 다음을 확인합니다.\n\n* HTTP를 사용하여 연결할 수 있습니다. 자세한 내용은 [복제 오류 문제 해결](/ko/repositories/creating-and-managing-repositories/troubleshooting-cloning-errors)을(를) 참조하세요.\n* 복제하려는 리포지토리에 액세스할 수 있는 권한이 있습니다. 자세한 내용은 [복제 오류 문제 해결](/ko/repositories/creating-and-managing-repositories/troubleshooting-cloning-errors#check-your-permissions)을(를) 참조하세요.\n* 복제하려는 기본 분기가 여전히 존재합니다. 자세한 내용은 [복제 오류 문제 해결](/ko/repositories/creating-and-managing-repositories/troubleshooting-cloning-errors#error-remote-head-refers-to-nonexistent-ref-unable-to-checkout)을(를) 참조하세요.\n\n## 추가 참고 자료\n\n* [연결 문제 해결](/ko/get-started/using-github/troubleshooting-connectivity-problems)"}