Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Gitlab Cookbook

You're reading from   Gitlab Cookbook Over 60 hands-on recipes to efficiently self-host your own Git repository using GitLab

Arrow left icon
Product type Paperback
Published in Dec 2014
Publisher
ISBN-13 9781783986842
Length 172 pages
Edition 1st Edition
Arrow right icon
Author (1):
Arrow left icon
Jeroen van Baarsen Jeroen van Baarsen
Author Profile Icon Jeroen van Baarsen
Jeroen van Baarsen
Arrow right icon
View More author details
Toc

Table of Contents (11) Chapters Close

Preface 1. Introduction and Installation 2. Explaining Git FREE CHAPTER 3. Managing Users, Groups, and Permissions 4. Issue Tracker and Wiki 5. Maintaining Your GitLab Instance 6. Webhooks, External Services, and the API 7. Using LDAP and OmniAuth Providers 8. GitLab CI A. Tips and Tricks Index

Cloning your repository and pushing code to it

In this recipe, we will take a look at cloning your repository from GitLab to your local machine. When you use Git Bash on Windows, the commands will be the same.

Getting ready

You need to create a new repository in your GitLab instance. In this example, we will use the repository named super-git.

How to do it…

In the following steps, we will set up our repository and push code to it:

  1. Go to the newly created repository.
  2. Select the URL in the top-right section.
    How to do it…
  3. Go to the folder where you want to check out the project in the terminal. No need to create a new folder for the project.
  4. Enter the Git clone command, and change the URL to the URL you just copied:
    $ git clone URL
    

    In my case, the URL is as follows:

    $ git clone git@146.185.139.107:jeroen/super-git.git
    

    The following screenshot shows you the output of this command:

    How to do it…
  5. You can now go to the folder and check whether it is a Git folder by running the following command:
    $ git status
    

    The following screenshot...

You have been reading a chapter from
Gitlab Cookbook
Published in: Dec 2014
Publisher:
ISBN-13: 9781783986842
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.
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 $19.99/month. Cancel anytime