---
sort: 5
title: Git basics
---

# Git basics

[Git](https://git-scm.com/) is a [version control system (VCS)](https://en.wikipedia.org/wiki/Version_control) that tracks the history of changes as people and teams collaborate on projects together.
As developers make changes to the project, any earlier version of the project can be recovered at any time.

Developers can review project history to find out _who_ made _what_ changes _when_ and _why_.

## Complete tutorials

### [Git Documentation](https://git-scm.com/docs)

- [Git Book](https://git-scm.com/book/en/v2)
- [Git: gittutorial](https://git-scm.com/docs/gittutorial)
- [Git: giteveryday](https://git-scm.com/docs/giteveryday)

### [Atlassian Git Tutorial](https://www.atlassian.com/git/tutorials)

Selected sections:

- [Saving changes](https://www.atlassian.com/git/tutorials/saving-changes) – `add`, `commit`, `diff`, `stash`
- [Inspecting a repository](https://www.atlassian.com/git/tutorials/inspecting-a-repository) – `status`, `log`, `tag`, `blame`
- [Undoing changes](https://www.atlassian.com/git/tutorials/undoing-changes) – `checkout`, `clean`, `revert`, `reset`, `rm`
- [Rewriting history](https://www.atlassian.com/git/tutorials/rewriting-history) – `commit`, `rebase`, `reflog`
- [Syncing](https://www.atlassian.com/git/tutorials/syncing) – `remote`, `fetch`, `push`, `pull`
- [Using branches](https://www.atlassian.com/git/tutorials/using-branches) – `branch`, `checkout`, `merge`

### [Using Git - GitHub Docs](https://docs.github.com/en/get-started/using-git)

Selected sections:

- [Pushing commits to a remote repository](https://docs.github.com/en/get-started/using-git/pushing-commits-to-a-remote-repository) – `push`
- [Getting changes from a remote repository](https://docs.github.com/en/get-started/using-git/getting-changes-from-a-remote-repository) – `clone`, `fetch`, `merge`, `pull`
- Rebasing
  - [About Git rebase](https://docs.github.com/en/get-started/using-git/about-git-rebase)
  - [Using Git rebase on the command line](https://docs.github.com/en/get-started/using-git/using-git-rebase-on-the-command-line)
- Resolving merge conflicts
  - [Resolving merge conflicts after a Git rebase](https://docs.github.com/en/get-started/using-git/resolving-merge-conflicts-after-a-git-rebase)
  - [Resolving a merge conflict using the command line](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/addressing-merge-conflicts/resolving-a-merge-conflict-using-the-command-line)

## How to write a Git commit message

- [Chris Beams: How to Write a Git Commit Message](https://cbea.ms/git-commit/)
- [Tim Pope: A Note About Git Commit Messages](https://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html)
- [Peter Hutterer: On commit messages](https://who-t.blogspot.com/2009/12/on-commit-messages.html)
- [Git Book: Commit Guidelines](https://git-scm.com/book/en/v2/Distributed-Git-Contributing-to-a-Project#_commit_guidelines)
- [Python for Data Science: Git best practices](https://www.python4data.science/en/latest/productive/git/best-practices.html#write-meaningful-commit-messages)

## Cheat sheets

- [Git Cheat Sheet](https://git-scm.com/cheat-sheet)
- [GitHub Git Cheat Sheet - GitHub Cheatsheets](https://training.github.com/downloads/github-git-cheat-sheet/)
- [Git cheat sheet \| Atlassian Git Tutorial](https://www.atlassian.com/git/tutorials/atlassian-git-cheatsheet)
- [git - the simple guide](https://rogerdudler.github.io/git-guide/)
- [Oh Shit, Git!?!](https://ohshitgit.com/)

## Tools

[Meld](https://meldmerge.org/) – Visual diff and merge tool that can be used with Git commands `git difftool` and `git mergetool`

[Tig](https://jonas.github.io/tig/) – Git repository browser
