Explore Courses Blog Tutorials Interview Questions
+13 votes
in DevOps and Agile by (19.7k points)
edited by

I'm starting to play with Git now and I'm a little bit confused. For me, looks like there are a lot of options to do the same thing. My question, for now, is what is the difference between the commands below:

  • git remote update
  • git fetch
  • git pull

Also which one is more applicable for update a local copy of a remote branch?

1 Answer

+9 votes
by (62.9k points)
git remote update can update all of your branches set to track remote ones, however not merge any changes in.
git fetch can update only the branch you are on, however not merge any changes in.
git pull can update and merge any remote changes of the present branch you are on.
This would be the one you use to update a local branch.

Browse Categories