CHAPTER 8 · 1 lesson · 13 exercises

Cloning and Tagging

Clone remote repositories, configure remote URLs, and mark release versions with tags.

0 / 13 solved

This chapter covers what you do on your very first day on an engineering team.

Most projects do not start with git init. Instead, you clone an existing team repository to your local machine.

  • git clone … duplicate a remote repository and its full history locally
  • git remote add … register a remote repository URL (such as origin) to a repository
  • git tag … pin an immutable tag to a specific commit (e.g. v1.0)

A cloned repository automatically sets up origin, allowing you to branch and push immediately.

Running git remote add yourself reveals that remotes are not magic; they are simply named URLs. origin is just the default convention.

Unlike branches, tags never move when new commits are added. They remain permanently pinned to mark release versions.

Lessons in this chapter

clone and tag

  1. 08Clone repositories and manage release tags (clone / remote / tag)Start development by cloning existing repositories with git clone, configure remotes with git remote, and manage release tags with git tag.Go to the exercises

Next up is “Rebase and Cherry-pick”. Rebase branches to maintain a linear history, and cherry-pick specific commits across branches.