Skip to Main Content
Pragmatic Guide to Git
book

Pragmatic Guide to Git

by Travis Swicegood
November 2010
Beginner content levelBeginner
160 pages
2h 50m
English
Pragmatic Bookshelf
Content preview from Pragmatic Guide to Git
21 Retrieving Remote Changes, Part II

Many people new to Git treat git fetch and git pull as synonyms. Understanding the differences between the two is important to understanding how Git handles remote repositories. Remember, remotes are read-only branches. You fetch changes from a remote repository into those branches (which are stored locally), instead of committing directly to them, and then merge those changes as necessary. You can use git pull to combine fetching and merging into one command.

git pull follows Git’s convention and assumes that you want to pull from the origin remote repository if you do not specify a remote. You must specify a remote if you want to provide a specific branch to pull from.

You can provide a full refspec—two ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Pragmatic Version Control Using Git

Pragmatic Version Control Using Git

Travis Swicegood
Git Version Control Cookbook - Second Edition

Git Version Control Cookbook - Second Edition

Kenneth Geisshirt, Emanuele Zattin(EUR), Aske Olsson, Rasmus Voss
Git for Programmers

Git for Programmers

Jesse Liberty

Publisher Resources

ISBN: 9781680500028Errata