Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Jika memiliki project LookML yang terhubung ke repositori Git, Anda dapat memindahkan LookML project tersebut ke repositori baru.
Ada dua kemungkinan pendekatan untuk masalah ini, yang keduanya dijelaskan di bagian berikut:
Reset koneksi Git: Solusi sederhana ini mempertahankan semua cabang pribadi dan bersama di Looker serta cocok untuk sebagian besar kasus penggunaan.
Meng-clone repositori Git: Solusi lanjutan ini lebih disukai jika Anda ingin segera melihat histori lengkap semua cabang yang pernah digunakan melalui UI penyedia Git Anda.
Solusi sederhana: Mereset koneksi Git
Jika Anda mereset koneksi Git dan memasukkan URL repositori Git baru, LookML akan dipindahkan ke repositori tersebut. Semua perubahan yang disimpan di cabang pribadi dan bersama akan dipertahankan dan dapat digunakan di Looker. Pada awalnya, UI penyedia Git Anda hanya akan menampilkan cabang master dan historinya. Cabang lain dan historinya akan muncul saat berikutnya commit dilakukan ke cabang tersebut. Untuk bermigrasi ke repositori baru menggunakan metode ini, ikuti langkah-langkah berikut:
Di tab Configuration pada halaman Project Settings, pilih tombol Reset Git Connection.
Di halaman Configure Git, masukkan URL Git baru (URL Git untuk repositori yang ingin Anda migrasikan), lalu pilih Continue.
Jika Anda menggunakan SSH untuk terhubung, pastikan untuk memilih Reset Key. Jika tidak, kunci SSH yang sama akan digunakan, yang dapat menyebabkan konflik jika kedua repositori dihosting oleh layanan yang sama (dalam hal ini, GitHub).
Untuk koneksi SSH, tambahkan kunci deployment baru ke repo Git Anda, dan pastikan untuk memberikan akses tulis di setelan kunci deployment repo Git. Jika Anda menggunakan HTTPS, masukkan kredensial login untuk repo Git Anda. Lihat halaman dokumentasi Menyiapkan dan menguji koneksi Git untuk mengetahui petunjuk lengkap tentang cara menyiapkan Git.
Setelah Anda mengikuti langkah-langkah ini, project Anda akan terhubung ke repositori baru.
Catatan: LookML project Anda tidak akan muncul di cabang master repositori baru hingga Anda men-deploy project ke produksi. Kecuali jika Anda men-deploy ke produksi, kode LookML hanya akan muncul di cabang pengembangan di repositori baru setelah Anda melakukan commit kode, atau mendorongnya ke jarak jauh (perintah Git yang tersedia di panel Tindakan Git).
Solusi lanjutan: Meng-clone repositori
Solusi sederhana yang dijelaskan sebelumnya akan mempertahankan histori semua cabang, tetapi hanya cabang master dan historinya yang akan terlihat di UI GitHub pada awalnya. Setelah commit dibuat di cabang pribadi atau bersama di Looker, cabang tersebut dan historinya akan muncul di UI GitHub. Solusi yang lebih canggih diperlukan untuk langsung melihat semua cabang dan historinya melalui UI GitHub.
Pertama, Anda harus memiliki akses ke repositori asli di GitHub (atau penyedia Git lainnya). Anda dapat menemukan URL repositori di bagian bawah halaman setelan project atau konfigurasi project.
Untuk contoh ini, anggap git@github.com:looker/PROJECT_NAME.git adalah repo asli dan git@github.com:your_organization/PROJECT_NAME.git adalah repo baru:
Clone repositori asli ke komputer Anda, dan download cabang yang ingin Anda pertahankan.
git clone git@github.com:looker/PROJECT_NAME.git
cd PROJECT_NAME
git checkout master
git pull
Reset URL jarak jauh repo. Lihat dokumentasi GitHub untuk mengetahui informasi selengkapnya.
git remote -v
Tindakan ini akan menampilkan repositori jarak jauh yang saat ini dituju repo Anda. Hasilnya akan terlihat seperti ini:
Sekarang, untuk memasukkan histori dan file untuk cabang developer, Anda harus melakukan git checkout dev_branch_name dan git push origin untuk setiap cabang developer. Hal ini dapat dilakukan secara manual atau dalam loop dalam skrip seperti yang ditunjukkan dalam contoh berikut:
#!/bin/bash
for branch in $(git branch --all | grep '^\s*remotes' | egrep --invert-match '(:?HEAD|master)$'); do
git branch --track "${branch##*/}" "$branch"
done
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Sulit dipahami","hardToUnderstand","thumb-down"],["Informasi atau kode contoh salah","incorrectInformationOrSampleCode","thumb-down"],["Informasi/contoh yang saya butuhkan tidak ada","missingTheInformationSamplesINeed","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 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)."]]