Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Git Best Practices Guide

You're reading from   Git Best Practices Guide Master the best practices of Git with the help of real-time scenarios to maximize team efficiency and workflow

Arrow left icon
Product type Paperback
Published in Nov 2014
Publisher
ISBN-13 9781783553730
Length 102 pages
Edition 1st Edition
Tools
Arrow right icon
Author (1):
Arrow left icon
PIDOUX Eric PIDOUX Eric
Author Profile Icon PIDOUX Eric
PIDOUX Eric
Arrow right icon
View More author details
Toc

Creating a server repository


In the first chapter, we saw how to create a simple local Git repository, but now, it's time to create a server repository that will store and manage the code. Of course, for our example, it will be created by GitLab, but not everyone wants GitLab or GitHub.

Note

A server repository, also called "bare repository", is a Git repository without a working copy.

Git can use four protocols to transport data:

  • Local

  • Secure Shell (SSH)

  • Git

  • HTTP

We will see how and when to use these protocols. We will also distinguish between the pros and cons of each protocol.

For all protocols, we have to create the bare repository by executing these lines on the server's command lines.

Erik@server:~$ mkdir webproject
#Create the folder
Erik@server:~$ cd webproject
#go inside it
Erik@server:~/webproject$ git init --bare 
Initialized empty Git repository in /home/erik/webproject

With these commands, we create a directory web project and initialize an empty Git bare repository.

Local

The local protocol...

lock icon The rest of the chapter is locked
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
Banner background image