Todos os cursos
Iniciante 10 hours Grátis

Git Basics: Version Control from Zero

Learn Git from scratch by practicing in a terminal inside your browser: commits, history, undoing changes, branches, merge, conflicts, rebase, GitHub, pull requests and team best practices.

Badge do curso Git Basics Conclua todas as aulas para ganhá-lo.
Git Basics: Version Control from Zero

Conteúdo do curso

Módulo 1

Getting started

4 aulas
1

What is Git?

What version control is, how Git was born, how it differs from GitHub, and why virtually every software team uses it.

20 min Grátis
2

Installing and configuring Git

How to install Git on Windows, macOS and Linux, check the version, and do the initial setup: name, email, main branch and editor.

25 min Grátis
3

The terminal in 15 minutes

The basic terminal commands you need to use Git: moving between folders, listing, creating, reading and editing files.

20 min Grátis
4

Your first repository

Create a repository with git init, understand what the .git folder is, and read what git status tells you.

25 min Grátis
Módulo 2

The basic cycle

5 aulas
5

Git's three areas

Working directory, staging area and repository: the mental model that explains every Git command and the lifecycle of a file.

25 min Grátis
6

Saving changes: git add and git commit

Stage files with git add (one, several or all), save commits with git commit -m, the -a shortcut, and how to read Git's response.

30 min Grátis
7

Good commit messages

How to write clear commit messages, how often to commit, and how to fix the last commit with git commit --amend.

20 min Grátis
8

Ignoring files with .gitignore

Which files should never go into a repository, how to write a .gitignore with patterns, and what to do if you already committed something you should have ignored.

20 min Grátis
9

Seeing what changed: git diff

Read the output of git diff, compare the working directory, the staging area and commits, and review your changes before saving them.

25 min Grátis
Módulo 3

History and undoing changes

4 aulas
10

Exploring the history

git log and its most useful options, git show to inspect a commit, what HEAD is, how to refer to earlier commits with ~ and ^, and how to travel to an old version.

30 min Grátis
11

Discarding changes: restore, rm and mv

Undo changes you haven't saved yet with git restore, take files out of the staging area, recover deleted files, and delete or rename files with Git.

25 min Grátis
12

Undoing commits: reset and revert

The two ways to undo commits: git revert creates a commit that cancels them and git reset moves the branch back (--soft, --mixed and --hard). When to use each one.

35 min Grátis
13

Setting work aside: git stash

Put changes aside without committing using git stash to deal with another task, and get them back later with pop or apply.

20 min Grátis
Módulo 4

Branches

4 aulas
14

Branches: branch and switch

What a branch is, how to create one, switch between branches, list, rename and delete them, and why branches are so cheap in Git.

30 min Grátis
15

Merging branches

Integrate one branch's work into another with git merge: fast-forward, three-way merge commit, the --no-ff option, and cleaning up finished branches.

30 min Grátis
16

Resolving conflicts

Why merge conflicts happen, how to read the <<<<<<< ======= >>>>>>> markers, resolve them step by step or cancel the merge, and how to avoid them.

35 min Grátis
17

Rebase and cherry-pick

Replay your commits on top of another branch with git rebase for a linear history, resolve conflicts during a rebase, copy a single commit with cherry-pick, and when NOT to rebase.

35 min Grátis
Módulo 5

Working as a team

3 aulas
18

Remote repositories and git push

Create a repository on GitHub or GitLab, connect it with git remote add, upload your commits with git push, understand the upstream, and authenticate with SSH or a token.

35 min Grátis
19

Working with others: clone, fetch and pull

Copy a repository with git clone, bring in your team's changes with git fetch and git pull, and what to do when your push is rejected because the remote has new work.

35 min Grátis
20

Pull requests and code review

The collaborative workflow on GitHub and GitLab: branch, push, open a pull request, review code, address comments, merge and clean up. Also how to contribute to other people's projects with a fork.

30 min Grátis
Módulo 6

Best practices

2 aulas
21

Tags and versions

Mark versions with git tag, the difference between lightweight and annotated tags, how to push them to the remote, and how to number versions with semantic versioning (SemVer).

25 min Grátis
22

Conventional commits and workflows

The Conventional Commits convention, the most common workflows (GitHub Flow, Git Flow and trunk-based), a list of best practices, and a final project to review the whole course.

35 min Grátis

Construa sua presença digital

Comece hoje: escreva para nós e respondemos em menos de 24 horas.