9

I have seen two different ways of merging local branches.

git checkout master
git merge new_feature


git checkout master
git pull . new_feature

What is the difference, pros/cons?

Matt Fenwick
  • 48,199
  • 22
  • 128
  • 192
Kris
  • 19,188
  • 9
  • 91
  • 111

2 Answers2

11

Locally speaking, there is no difference between merge and pull. When dealing with remotes, "pull" fetches the remote's objects first, then merges with the local branch. But when dealing with local branches, there is nothing to fetch (all objects are already in the local repository) so the "fetch" part of pulling is effectively a no-op. In the local case, then, "pull" is basically the same as just "merge".

Dan Moulding
  • 211,373
  • 23
  • 97
  • 98
0

In this case, there is no difference.

Milan Babuškov
  • 59,775
  • 49
  • 126
  • 179