Git Tutorials

Diffs

Learn Git: Diffs

Beginner Git Tutorial

What are Git diffs? A diff in Git takes two data sets—like files, commits, or branches—and tells you what has changed between them.

Watch this beginner Git tutorial video to learn what diffs are in Git and how to view the diff between multiple commits or branches to compare the changes between them. When viewing the diff of files, the diff text will be highlighted in green with a + sign for added files, and the diff text will be highlighted in red with a - sign for deleted files.

Diffs provided useful information about your Git repository and can be helpful for reviewing changes while staging, helping you decide whether to merge or rebase, or simply copying and pasting code from a file.