Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
Wenn Sie ein LookML-Projekt haben, das mit einem Git-Repository verknüpft ist, können Sie die LookML dieses Projekts in ein neues Repository verschieben.
Es gibt zwei mögliche Ansätze für dieses Problem, die in den folgenden Abschnitten beschrieben werden:
Git-Verbindung zurücksetzen: Bei dieser einfachen Lösung bleiben alle privaten und freigegebenen Branches in Looker erhalten. Sie eignet sich für die meisten Anwendungsfälle.
Git-Repository klonen: Diese erweiterte Lösung wird bevorzugt, wenn Sie den vollständigen Verlauf aller Zweige, die jemals über die Benutzeroberfläche Ihres Git-Anbieters verwendet wurden, sofort sehen möchten.
Einfache Lösung: Git-Verbindung zurücksetzen
Wenn Sie die Git-Verbindung zurücksetzen und eine neue Git-Repository-URL eingeben, wird die LookML in dieses Repository verschoben. Alle gespeicherten Änderungen in privaten und freigegebenen Branches bleiben erhalten und können in Looker verwendet werden. In der Benutzeroberfläche Ihres Git-Anbieters wird zuerst nur der Master-Branch und sein Verlauf angezeigt. Andere Branches und deren Verlauf werden angezeigt, sobald der nächste Commit für diesen Branch ausgeführt wird. So migrieren Sie mit dieser Methode zu einem neuen Repository:
Klicken Sie auf der Seite Projekteinstellungen auf dem Tab Konfiguration auf die Schaltfläche Git-Verbindung zurücksetzen.
Geben Sie auf der Seite Git konfigurieren die neue Git-URL (die Git-URL für das Repository, in das Sie migrieren möchten) ein und wählen Sie dann Weiter aus.
Wenn Sie eine SSH-Verbindung verwenden, wählen Sie Schlüssel zurücksetzen aus. Andernfalls wird derselbe SSH-Schlüssel verwendet, was zu einem Konflikt führen kann, wenn beide Repositories vom selben Dienst gehostet werden (in diesem Fall GitHub).
Fügen Sie für SSH-Verbindungen den neuen Bereitstellungsschlüssel Ihrem Git-Repository hinzu und gewähren Sie in den Einstellungen für den Bereitstellungsschlüssel des Git-Repositorys Schreibzugriff. Wenn Sie HTTPS verwenden, geben Sie die Anmeldedaten für Ihr Git-Repository ein. Eine vollständige Anleitung zum Einrichten von Git finden Sie auf der Dokumentationsseite Git-Verbindung einrichten und testen.
Danach ist Ihr Projekt mit dem neuen Repository verbunden.
Hinweis:Die LookML Ihres Projekts wird erst dann im Master-Branch des neuen Repositories angezeigt, wenn Sie Ihr Projekt in die Produktion bereitgestellt haben. Sofern Sie nicht die Produktionsversion bereitstellen, wird Ihr LookML-Code erst im Entwicklungszweig des neuen Repositorys angezeigt, nachdem Sie den Code committet oder per Push an das Remote-Repository übertragen haben (Git-Befehl, verfügbar im Bereich Git-Aktionen).
Erweiterte Lösung: Repository klonen
Bei der einfachen Lösung, die oben beschrieben wurde, wird der Verlauf aller Branches beibehalten. In der GitHub-Benutzeroberfläche sind jedoch nur der Master-Branch und sein Verlauf zu sehen. Sobald ein Commit in Looker für einen privaten oder freigegebenen Branch vorgenommen wurde, werden dieser Branch und sein Verlauf in der GitHub-Benutzeroberfläche angezeigt. Eine erweiterte Lösung ist erforderlich, um alle Branches und ihren Verlauf sofort über die GitHub-Benutzeroberfläche aufzurufen.
Dazu benötigen Sie Zugriff auf das ursprüngliche Repository in GitHub (oder einem anderen Git-Anbieter). Sie finden die Repository-URL unten in den Projekteinstellungen oder auf der Seite „Projektkonfiguration“.
Angenommen, git@github.com:looker/PROJECT_NAME.git ist das ursprüngliche Repository und git@github.com:your_organization/PROJECT_NAME.git das neue Repository:
Klonen Sie das ursprüngliche Repository auf Ihren Computer und laden Sie die Zweige herunter, die Sie beibehalten möchten.
git clone git@github.com:looker/PROJECT_NAME.git
cd PROJECT_NAME
git checkout master
git pull
Setzen Sie die Remote-URL des Repos zurück. Weitere Informationen finden Sie in der GitHub-Dokumentation.
git remote -v
Hier sehen Sie die Remotes, auf die Ihr Repository derzeit verweist. Die Ergebnisse sehen in etwa so aus:
Wenn Sie den Verlauf und die Dateien für Entwicklungszweige einbinden möchten, müssen Sie für jeden Entwicklungszweig git checkout dev_branch_name und git push origin ausführen. Das kann manuell oder in einer Schleife in einem Script erfolgen, wie im folgenden Beispiel gezeigt:
#!/bin/bash
for branch in $(git branch --all | grep '^\s*remotes' | egrep --invert-match '(:?HEAD|master)$'); do
git branch --track "${branch##*/}" "$branch"
done
Übertragen Sie die Änderungen dann mit git push --all an die Zweige.
Setzen Sie die Git-Verbindung in Looker auf diese neue URL zurück und richten Sie einen Bereitstellungsschlüssel in diesem neuen Repository ein (siehe Schritte im Abschnitt zur einfachen Lösung oben auf dieser Seite).
[[["Leicht verständlich","easyToUnderstand","thumb-up"],["Mein Problem wurde gelöst","solvedMyProblem","thumb-up"],["Sonstiges","otherUp","thumb-up"]],[["Schwer verständlich","hardToUnderstand","thumb-down"],["Informationen oder Beispielcode falsch","incorrectInformationOrSampleCode","thumb-down"],["Benötigte Informationen/Beispiele nicht gefunden","missingTheInformationSamplesINeed","thumb-down"],["Problem mit der Übersetzung","translationIssue","thumb-down"],["Sonstiges","otherDown","thumb-down"]],["Zuletzt aktualisiert: 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)."]]