Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Development Tools Git Branches and Merging Remote Branches Remote Branches

Chidiebere Ekennia
Chidiebere Ekennia
5,950 Points

I'm confused

Why couldn't we use git pull instead of git merge to update the local branch in this example

1 Answer

Michael Hulet
Michael Hulet
47,913 Points

You definitely should be able to use git pull here also. I think Jay was just trying to go the long way to give you a better understanding of what's happening. git pull origin master is technically just shorthand for git fetch origin && git merge origin/master. When you run git pull, it downloads all the latest changes from the remote repository (which is what git fetch does) and updates your local branch to have those same changes (which is what git merge does), so git pull is just a way to do exactly what Jay did in the video with 2 commands, but only using 1