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
Git Essentials

You're reading from   Git Essentials Create, merge, and distribute code with Git, the most powerful and flexible versioning system available

Arrow left icon
Product type Paperback
Published in Apr 2015
Publisher
ISBN-13 9781785287909
Length 168 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Ferdinando Santacroce Ferdinando Santacroce
Author Profile Icon Ferdinando Santacroce
Ferdinando Santacroce
Arrow right icon
View More author details
Toc

Taking another way – Git branching

Now, it's time to introduce one of the most used features of a versioning system: branching. This is a thing that you will use extensively and a thing that Git does well.

Anatomy of branches

A branch is essentially another way your repository takes. While programming, you will use branches to experiment with changes, without breaking the working code. You will use them to keep track of some extensive work, such as the development of a new feature, to maintain different versions or releases of your project. To put it simply, you will use it always.

When in a Git repository, you are always in a branch. If you pay attention to the Bash shell, you can easily find the branch that you are on at the moment. It is always at the prompt, within brackets, as shown here:

Anatomy of branches

The master branch is, conventionally, the default branch. When you do your first commit in a brand new repo, you actually do the first commit in the master branch.

During the course of the...

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 R$50/month. Cancel anytime