I’ve read from various sources that it’s usually a better idea to fetch then merge rather than simply pull as it allows for finer control. That said, I’ve yet to find actually how to do it. Case in point:
There was a small change made to some of the code in one of my GitHub repository’s master branch. I was able to fetch it, but I don’t know how to actually merge the differences in with my local master branch. git branch lists all of the local branches I have, but nothing indicating anything to merge to.
So, is it just something like git merge master or git merge origin/master? What am I missing?
git merge origin/mastershould work. Sincemasteris usually a tracking branch, you could also dogit pullfrom that branch and it will do a fetch & merge for you.If you have local changes on your
masterthat aren’t reflected onorigin, you might wantgit rebase origin/masterto make sure your commits are ‘on top’.