Reader small image

You're reading from  GitLab Quick Start Guide

Product typeBook
Published inNov 2018
PublisherPackt
ISBN-139781789534344
Edition1st Edition
Tools
Concepts
Right arrow
Author (1)
Adam O'Grady
Adam O'Grady
author image
Adam O'Grady

Adam O'Grady hails from the remote Perth, Western Australia, and can usually be found on Twitter at @adamjogrady or in meatspace wrangling with code. His first taste of programming came from building games into graphics calculators at high school, and quickly developed into a passion. A few years later, while doing social media marketing for an ISP, his first big break arrived; building custom applications to monitor and respond to social feeds. After that, he spent a few years working for the government building systems that used satellite and geographic data to spot and predict bushfires, and now you can find him leading a small team of engineering mavens at a local health start-up.
Read more about Adam O'Grady

Right arrow

Porting from GitHub or Subversion (SVN)

So far, we've explored GitLab as a code hosting platform and looked at creating new projects on it. While this is perfect if you're starting out with GitLab in your organization, you may have an existing code-hosting platform, or even use a different version control system for your projects, and are looking at moving to GitLab.

Thankfully, GitLab has recognized this as a barrier to people moving over, and provides a number of easy methods for moving your projects to it as a code-hosting and testing platform. In this chapter, we'll look at the following:

  • Moving to GitLab from GitHub, and more
  • Moving to GitLab from a Git repository
  • Moving from Subversion (SVN) to GitLab

Changing code-hosting platform

Many organizations, and even just established personal projects, already have a preferred code-hosting platform. There are a lot on the market and they all have benefits and drawbacks that can lead to them being chosen. However, times change and sometimes business or project needs can force a move to a different platform. We'll now look at some common reasons that your organization might have for changing their code-hosting platform:

  • Cost: GitLab.com is free to use; paid accounts only unlock extra features. You can also host a GitLab instance on your existing hardware.
  • Data sovereignty: You can host your own GitLab instance on your own hardware and be in control of your data.
  • Trust and transparency: GitLab is free and open source software (FOSS); you can examine the code that runs on your instance or GitLab.com, and be certain that it&apos...

Moving from another version control system

You may also be in a situation where you aren't using Git for code version control. For historical reasons, or due to familiarity with other version control systems, your organization or project may have been stored in a SVN, Mercurial, or other version control system (VCS) repository. While different VCSes can have vastly different methods of operation, and even completely alien underlying storage models, there are some methods for extracting data from one system and loading it into another.

In this section, we'll run through a couple of the most common VCSes used today and how to convert to Git (and GitLab) from them.

Subversion

One of the most common alternative version...

Summary

After this chapter, you should feel confident in importing projects to GitLab from a variety of different sources. This is important because in many situations you may already have an established VCS or a code-hosting platform before you look at moving to GitLab, and it greatly reduces friction in moving to a new platform if you can easily import existing work.

We started the chapter by looking at importing from the biggest code-hosting platform around, GitHub. We looked at two methods of migrating: using the OAuth2 flow and using personal access tokens. Next up, we examined BitBucket by Atlassian and how to import Git projects from BitBucket into GitLab using the OAuth2 workflow. We then looked at importing any Git repository that can be accessed via URL, as well as the most low-tech method of simply downloading an existing repository to your local machine, changing the...

lock icon
The rest of the chapter is locked
You have been reading a chapter from
GitLab Quick Start Guide
Published in: Nov 2018Publisher: PacktISBN-13: 9781789534344
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime

Author (1)

author image
Adam O'Grady

Adam O'Grady hails from the remote Perth, Western Australia, and can usually be found on Twitter at @adamjogrady or in meatspace wrangling with code. His first taste of programming came from building games into graphics calculators at high school, and quickly developed into a passion. A few years later, while doing social media marketing for an ISP, his first big break arrived; building custom applications to monitor and respond to social feeds. After that, he spent a few years working for the government building systems that used satellite and geographic data to spot and predict bushfires, and now you can find him leading a small team of engineering mavens at a local health start-up.
Read more about Adam O'Grady