Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Git Essentials

You're reading from  Git Essentials

Product type Book
Published in Apr 2015
Publisher
ISBN-13 9781785287909
Pages 168 pages
Edition 1st Edition
Languages
Author (1):
Ferdinando Santacroce Ferdinando Santacroce
Profile icon Ferdinando Santacroce

Tricks


In this section, I would suggest just a bunch of tips and tricks that I found useful in the past.

Bare repositories

Bare repositories are repositories that do not contain working copy files but contain only the .git folder. A bare repository is essentially for sharing; if you use Git in a centralized way, pushing and pulling to a common remote (a local server, a GitHub repository, or so on), you will agree that the remote has no interest in checking out files you work on; the scope of that remote is only to be a central point of contact for the team, so having working copy files in it is a waste of space, and no one will edit them directly on the remote.

If you want to set up a bare repository, you have to use only the --bare option:

$ git init --bare NewRepository.git

As you may have noticed, I called it NewRepository.git, using a .git extension; this is not mandatory but is a common way to identify bare repositories. If you pay attention, you will note that even in GitHub every repository...

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 $15.99/month. Cancel anytime}