Skip to Main Content
Pragmatic Version Control Using Git
book

Pragmatic Version Control Using Git

by Travis Swicegood
December 2008
Intermediate to advanced content levelIntermediate to advanced
184 pages
4h 47m
English
Pragmatic Bookshelf
Content preview from Pragmatic Version Control Using Git

7.3 Keeping Up-to-Date

Cloning gets you the history of a repository up to the point you clone it, but other developers will still be making changes and updating the repository with those changes after you clone it. You need to fetch those changes from the remote repository. You do this by using the git fetch command.

Fetching changes updates your remote branches. You can see your local branches when you run git branch. If you add the -r parameter, Git shows you the remote branches:

 
​prompt> git branch -r
 
​ origin/HEAD​
 
​ origin/master​

You can check out those branches like a normal branch, but you should not change them. If you want to make a change to them, create a local branch from them first, and then ...

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

Git: Mastering Version Control

Git: Mastering Version Control

Ferdinando Santacroce, Aske Olsson, Rasmus Voss, Jakub Narębski
Pragmatic Guide to Git

Pragmatic Guide to Git

Travis Swicegood
Git Version Control Cookbook - Second Edition

Git Version Control Cookbook - Second Edition

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

Publisher Resources

ISBN: 9781680500189Errata Page