🔀Git Fetch
Also known as Fetch
Getting the new commits from the remote. Your own files stay just as they were.
Think of it like
Think of it like checking the post box. You see the new letters, but you have not opened them yet.
Example
Jack fetches before lunch. Git tells him main is one commit behind, so he reads Emma's change before he pulls it.
Why it matters
Fetching lets you look before you leap. You see what others did without risking your own work.
Definition
Example code
console
$ git fetch
From https://example.com/ada/shop
68ba79c..643e9b2 main -> origin/main
$ git status
On branch main
Your branch is behind 'origin/main' by 1 commit, and can be fast-forwarded.Common mistake
Key takeaways
- 1Download only. Your files stay as they are.
- 2Look first. See changes before mixing them in.
- 3Always safe. It cannot break your work.