Published on: August 28, 2024
3 min read
Google Cloud is deprecating Cloud Source Repositories. Learn how to migrate a CSR source code repository to GitLab, along with best practices.
Google Cloud’s deprecation of Cloud Source Repositories (CSR) has prompted development teams to seek a full-featured alternative for their source code repositories. GitLab, a Google Cloud Technology Partner, is a strong choice due to its comprehensive DevSecOps capabilities.
In this tutorial, you'll learn the steps to ensure a smooth transition from CSR to GitLab, whether you're using GitLab.com or a self-managed instance on Google Cloud.
Transitioning from Google Cloud Source Repositories to GitLab is a recommended step. As a strategic partner of Google Cloud, GitLab seamlessly integrates with existing infrastructure with ease and brings value to customers in the following ways:
Before you start the migration, ensure you have:
read_repository
and write_repository
scopes enabled. This token will be used to authenticate your Git operations during the migration process.git status
in the Cloud Shell to check the current branch and ensure everything is in order before pushing to GitLab.git remote add origin [GITLAB_PROJECT_URL]
[GITLAB_PROJECT_URL]
with the actual URL of your GitLab project.
Push to GitLab: Finally, push your local repository to GitLab by running:git push -u origin [BRANCH_NAME]
[BRANCH_NAME]
with the current branch name you noted earlier.
When prompted, use your GitLab username and the PAT as the password to authenticate and complete the push.Moving from Google Cloud Source Repositories to GitLab is easy and offers more benefits than just managing source code. GitLab, with its integration with Google Cloud, makes it an ideal choice for developers seeking to enhance their workflow post-migration.
Read more about GitLab's integration with Google Cloud.