You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/basics.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
layout: default
3
3
title: 2 - Git Basics
4
4
nav_order: 4
5
-
last_modified_date: "2025-04-28 02:13AM"
5
+
last_modified_date: "2026-03-10 02:13AM"
6
6
---
7
7
8
8
# Git Basics
@@ -22,15 +22,15 @@ This page covers the most essential commands when tracking your code using `git`
22
22
23
23
## Diff
24
24
25
-
Git was designed to track changes made to files and their location within a project. `git diff` is one of the best ways to see how things have actually changed. `git diff` is a function that takes two input data sets and outputs the changes between them.
25
+
Git was designed to track changes made to files and their location within a project. `git diff` is one of the best ways to see how things have actually changed. `git diff` is a function that takes two input data sets and outputs the changes between them. Typically this means examining the current version of a file and comparing it to the tracked version in `git`.
26
26
27
27
For example, imagine that you have cleaned up your code a bit, added some new functionality, and inserted more comments inline. But you step away from your desk (or go to sleep or it's suddenly the weekend) and you need a reminder of what changes have been made to file before you add and commit it? `git diff` can tell you.
28
28
29
29
A command like this:
30
30
```
31
31
git diff filename.py
32
32
```
33
-
will show you a detailed inventory of inserted lines (which start with `+` and are highlighted in blue), deleted lines (which start with `-` and are highlighted in red) for the entire file.
33
+
will show you a detailed inventory of inserted lines (which start with `+` and are highlighted in blue), deleted lines (which start with `-` and are highlighted in red) for a single file.
34
34
35
35
Or if you need to compare the structure of two directories:
36
36
```
@@ -178,8 +178,8 @@ How is `fetch` different from `pull`? Pulling updates the HEAD of your repositor
178
178
179
179
180
180
{: .important }
181
-
**How are `pull` and `fetch` different or similar?**
182
-
**`git fetch`** downloads changes from the remote and stores them in your remote-tracking branches (like `origin/main`), but leaves your working branch and local files completely untouched. You're essentially saying "show me what's out there" — you can then inspect the changes before deciding what to do with them.
181
+
**How are `pull` and `fetch` different or similar?**<br /><br />
182
+
**`git fetch`** downloads changes from the remote and stores them in your remote-tracking branches (like `origin/main`), but leaves your working branch and local files completely untouched. You're essentially saying "show me what's out there" — you can then inspect the changes before deciding what to do with them.<br /><br />
183
183
**`git pull`** does a fetch and then immediately merges (or rebases, if configured) the fetched changes into your current branch. It's the two-step process collapsed into one command — convenient, but it can introduce merge commits or conflicts without you explicitly deciding to merge.
0 commit comments