Version First Edition
Platform Git 2.28
Editor Console

Learn Git!

Chances are if you’re involved with software development you’ve heard of and have used Git at some point in your life. Version control systems are critical for any successful collaborative software project. Git is both simple to start using and accommodating for the most complex tasks with version control. Even seasoned Git users hit roadblocks on how to handle common situations.

Git Apprentice is here to help! This book is the easiest and fastest way to get hands-on experience with using Git for version control of your projects.

Who This Book Is For

This book is for anyone who would like to leverage the power of version control with Git in their software development process. The book starts with a gentle introduction to Git. It then moves on to walk you through creating a new repository, cloning an existing one, merging in changes, and all of the bits in between.

Topics Covered in Git Apprentice

  • A Crash Course in Git: Learn how to get started with Git, the differences between platforms, and a quick overview of the typical Git workflow.
  • Cloning a Repo: Discover how to clone a remote repo to your local machine, and what constitutes “forking” a repository.
  • Git Log & History: You’ll discover the versatility of the git log command—displaying branches, graphs and even filtering the history.
  • Creating a Repository: If you are starting a new project, and want to use Git for source control, you first need to create a new repository.
  • And more!

One thing you can count on: after reading this book, you’ll be well-prepared to use Git in your own software development workflow!

Before You Begin

This section tells you a few things you need to know before you get started, such as what you’ll need for hardware and software, where to find the project files for this book, and more.

i

iii

iv

Section I: Beginning Git

This section is intended to get newcomers familiar with Git. It will introduce the basic concepts that are central to Git, how Git differs from other version control systems, and the basic operations of Git like committing, merging, and pulling.

You may discover things in this section you didn’t quite understand about Git, even if you’ve used Git for a long time.

Learn how to get started with Git, the differences between platforms, and a quick overview of the typical Git workflow.

1

It’s quite common to start by creating a copy of somebody else's repository. Discover how to clone a remote repo to your local machine, and what constitutes "forking" a repository.

2

A Git repo is made up of a sequence of commits—each representing the state of your code at a point in time. Discover how to create these commits to track the changes you make in your code.

3

Before you can create a Git commit, you have to use the “add” command. What does it do? Discover how to use the staging area to great effect through the interactive git add command.

4

Sometimes, there are things that you really don’t want to store in your source code repository.

5

There’s very little point in creating a nice history of your source code if you can’t explore it. You’ll discover the versatility of the git log command—displaying branches, graphs and even filtering the history.

6

The real power in Git comes from its branching and merging model. This allows you to work on multiple things simultaneously. Discover how to manage branches, and exactly what they are in this chapter.

7

Branches in Git without merging would be like basketball without the hoop—fun, sure, but with very little point. In this chapter you’ll learn how you can use merging to combine the work on multiple branches back into one.

8

You’ve been working hard on your local copy of the Git repository, and now you want to share this with your friends. See how you can share through using remotes, and how you can use multiple remotes at the same time.

9

If you are starting a new project, and want to use Git for source control, you first need to create a new repository.

10

Meet the team

Contributors

Who is this book for

This book is for anyone who would like to leverage the power of version control with Git in their software development process.

Concepts covered in this book

  • Setting up repos
  • Staging
  • Syncing
  • Merging

Version history

First Edition · Git 2.28, Console

v1.1 · Oct 29 2020 · Chris Belanger & Sam Davies

First Edition · Git 2.28, Console

v1.0 · Oct 1 2020 · Chris Belanger & Sam Davies

Git Apprentice

By Chris Belanger & Sam Davies

Learn how Git works under the hood, how to set up your own repos, as well as how to deal with remote syncing.

Read for Free with an Ultimate Beginner Subscription* * Includes this and all other Beginner books in our online library See all benefits
Buy Individually $59.99* *Includes access to all of our online reading features.
See buying options
Hide buying options

All videos. All books.
One low price.

A raywenderlich.com subscription is the best way to learn and master mobile development — plans start at just $19.99/month!

Learn iOS, Swift, Android, Kotlin, Flutter and Dart development and unlock our massive catalog of 50+ books and 4,000+ videos.