Git 저장소에 연결된 LookML 프로젝트가 있는 경우, 프로젝트의 LookML을 새 저장소로 이동해야 할 수 있습니다.
이 문제에 대한 가능한 두 가지 접근 방식은 모두 다음 섹션에서 설명합니다.
Git 연결 재설정: 이 간단한 솔루션은 Looker의 모든 개인 및 공유 브랜치를 보존하며 대부분의 사용 사례에 적합합니다.
Git 저장소 클론: 이 고급 솔루션은 Git 제공업체의 UI를 통해 사용된 모든 브랜치의 전체 기록을 즉시 볼 수 있어야 하는 경우에 적합합니다.
간단한 솔루션: Git 연결 재설정
Git 연결을 재설정하고 새 Git 저장소 URL을 입력하면 LookML이 해당 저장소로 이동합니다. 개인 및 공유 브랜치에 저장된 모든 변경사항은 Looker에서 유지관리되고 사용 가능합니다. 처음에는 Git 제공업체의 UI에 마스터 브랜치와 기록만 표시됩니다. 다른 브랜치 및 기록은 해당 브랜치의 다음 커밋 시 표시됩니다. 이 방법을 사용하여 새 저장소로 마이그레이션하려면 다음 단계를 따르세요.
Git 구성 페이지에서 새 Git URL(마이그레이션할 저장소의 Git URL)을 입력하고 계속을 선택합니다.
SSH를 통해 연결하는 경우 키 재설정을 선택해야 합니다. 그렇지 않으면 동일한 SSH 키가 사용되므로 두 저장소가 동일한 서비스(이 경우 GitHub)에서 호스팅되는 경우 충돌이 발생할 수 있습니다.
SSH 연결의 경우 Git 저장소에 새 배포 키를 추가하고 Git 저장소 배포 키 설정에서 쓰기 액세스 권한을 부여해야 합니다. HTTPS를 사용하는 경우 Git 저장소의 로그인 사용자 인증 정보를 입력합니다. Git 설정에 대한 자세한 안내는 Git 연결 설정 및 테스트 문서 페이지를 참조하세요.
이 단계를 완료하면 프로젝트가 새 저장소에 연결됩니다.
참고:프로젝트를 프로덕션에 배포할 때까지 프로젝트 LookML이 새 저장소의 마스터 브랜치에 표시되지 않습니다. 프로덕션에 배포하지 않는 한 LookML 코드는 코드를 커밋하거나 Git 작업 패널에서 사용할 수 있는 원격 Git 명령어로 푸시한 후 새 저장소의 개발 브랜치에만 표시됩니다.
고급 솔루션: 저장소 클론
앞에서 설명한 간단한 솔루션에서는 모든 브랜치의 기록을 보존하지만 처음에는 마스터 브랜치와 기록만 GitHub UI에 표시됩니다. Looker의 개인 또는 공유 브랜치에서 커밋이 수행되면 해당 브랜치와 기록이 GitHub UI에 나타납니다. GitHub UI를 통해 모든 브랜치 및 기록을 즉시 보려면 고급 솔루션이 필요합니다.
먼저 GitHub(또는 기타 Git 제공업체)에서 원본 저장소에 액세스할 수 있어야 합니다. 저장소 URL은 프로젝트 설정 또는 프로젝트 구성 페이지 하단에서 찾을 수 있습니다.
이 예시에서는 git@github.com:looker/PROJECT_NAME.git이 원래 저장소이고 git@github.com:your_organization/PROJECT_NAME.git이 새 저장소라고 가정합니다.
원래 저장소를 컴퓨터에 클론하고 보존할 브랜치를 가져오기합니다.
git clone git@github.com:looker/PROJECT_NAME.git
cd PROJECT_NAME
git checkout master
git pull
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["이해하기 어려움","hardToUnderstand","thumb-down"],["잘못된 정보 또는 샘플 코드","incorrectInformationOrSampleCode","thumb-down"],["필요한 정보/샘플이 없음","missingTheInformationSamplesINeed","thumb-down"],["번역 문제","translationIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-07-30(UTC)"],[],[],null,["# Migrating to a new Git repository\n\nIf you have a LookML project that is connected to a Git repository, you might want to move that project's LookML to a new repository.\n\n\nThere are two possible approaches to this problem, both of which are described in the following sections:\n\n- [**Reset the Git connection**](#simple_solution): This simple solution preserves all personal and shared branches in Looker and is suitable for the majority of use cases.\n- [**Clone the Git repository**](#advanced_solution): This advanced solution is preferred when it is important to be able to immediately see the complete history of all branches ever used through your Git provider's UI.\n\nSimple solution: Resetting the Git connection\n---------------------------------------------\n\n\nIf you [reset the Git connection](/looker/docs/setting-up-git-connection#integrating_looker_with_git) and enter a new Git repository URL, then the LookML will be moved over to that repository. All saved changes in personal and shared branches will be maintained and usable in Looker. At first, your Git provider's UI will only show the master branch and its history. Other branches and their history will appear the next time a commit is made to that branch. To migrate to a new repository using this method, follow these steps:\n\n1. Navigate to the [**Project Settings** page](/looker/docs/git-options#project_settings) for that project.\n2. On the [**Configuration** tab](/looker/docs/git-options#configuration) of the **Project Settings** page, select the **Reset Git Connection** button.\n3. On the **Configure Git** page, enter the new Git URL (the Git URL for the repository to which you want to migrate), and then select **Continue**.\n4. If you are using SSH to connect, be sure to select **Reset Key**. Otherwise, the same SSH key will be used, which can cause a conflict if both repositories are hosted by the same service (in this case, GitHub).\n5. For SSH connections, add the new deploy key to your Git repo, and be sure to grant write access in the Git repo deploy key settings. If you are using HTTPS, enter the login credentials for your Git repo. See the [Setting up and testing a Git connection](/looker/docs/setting-up-git-connection#integrating_looker_with_git) documentation page for full instructions on setting up Git.\n\n\nOnce you have followed these steps, your project will be connected to the new repository.\n\u003e **Note:** Your project LookML will not appear in the master branch of the new repository until you [deploy your project to production](/looker/docs/version-control-and-deploying-changes#deploying_to_production). Unless you deploy to production, your LookML code will appear only on your development branch in the new repository after [you commit the code](/looker/docs/version-control-and-deploying-changes#committing_changes), or push it to remote (a [Git command](/looker/docs/git-command-reference#push_changes_remote) available in the [**Git Actions** panel](/looker/docs/git-command-reference)).\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\nAdvanced solution: Cloning the repository\n-----------------------------------------\n\n\nThe [simple solution described previously](#simple_solution) will preserve the history of all branches, but only the master branch and its history will be visible in the GitHub UI at first. Once a commit is made on a personal or shared branch in Looker, that branch and its history will appear in the GitHub UI. A more advanced solution is necessary to immediately view all branches and their history through the GitHub UI.\n\n\nFirst, you need to have access to the original repository in GitHub (or other Git provider). You can find the repository URL at the bottom of the project settings or project configuration page.\n\n\nFor this example, suppose that `git@github.com:looker/PROJECT_NAME.git` is the original repo and `git@github.com:your_organization/PROJECT_NAME.git` is the new repo:\n\n1. Clone the original repository onto your computer, and pull down the branches you want to preserve.\n\n ```\n git clone git@github.com:looker/PROJECT_NAME.git\n cd PROJECT_NAME\n git checkout master\n git pull\n ```\n2. Reset the repo's remote URL. See the [GitHub documentation](https://help.github.com/articles/changing-a-remote-s-url/) for more information.\n\n ```\n git remote -v\n ```\n\n This shows you the remote(s) to which your repo is currently pointing. The results will look something like this: \n\n ```\n origin git@github.com:looker/PROJECT_NAME.git (fetch)\n origin git@github.com:looker/PROJECT_NAME.git (push)\n ```\n3. Next, set the origin remote to the new repo:\n\n ```\n git remote set-url origin git@github.com:your_organization/PROJECT_NAME.git\n git push origin master\n ```\n4. Now, to bring in history and files for dev branches, you'll need to do `git checkout dev_branch_name` and `git push origin` for each dev branch. This can be done manually or in a loop in a script such as shown in the following example:\n\n ```\n #!/bin/bash\n for branch in $(git branch --all | grep '^\\s*remotes' | egrep --invert-match '(:?HEAD|master)$'); do\n git branch --track \"${branch##*/}\" \"$branch\"\n done\n ```\n\n Then push the branches with `git push --all`.\n5. Reset the Git connection in Looker to this new URL and set up a deploy key on this new repo (see the [steps in the simple solution section](#simple_solution) earlier on this page)."]]