Getting ready

Follow these steps:

  1. We will start by checking out a local branch that tracks a remote branch:
$ git checkout -b remoteBugFix --track origin/stable-3.2 
Branch remoteBugFix set up to track remote branch stable-3.2 from origin. 
Switched to a new branch 'remoteBugFix'
  1. The previous command creates and checks out the remoteBugFix branch that will track the origin/stable-3.2 branch. Therefore, for instance, executing git status will automatically show how different your branch is from origin/stable-3.2, and it will also show whether your branch's HEAD can be fast forwarded to the HEAD of the remote branch or not.
  2. To provide an example of how the previous step works, we need to do some manual work that will simulate this situation. ...

Get Git Version Control Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.