0

On my local, if the HEAD is currently at branch_1, and if I do:

  1. git fetch origin

Would Git fetch from origin the updates of all branches? Or just updates of only branch_1?

  1. git fetch branch_2

Would Git fetch only origin's branch_2? If yes, then would it fetch to my local's branch_1 or branch_2?

Jonas
  • 121,568
  • 97
  • 310
  • 388
roht
  • 49
  • 1
  • 3
  • 1
    The `git fetch` command does not update any of *your* branches. Your branches are *yours*. Instead, it fetches commits from the other Git repository (the "remote" named `origin` in this case) and then updates your corresponding *remote-tracking names* (`origin/branch_1` and `origin/branch_2`, for instance). Having done this fetch, you might now want to update some or all of your own branches based on what the fetch fetched. – torek Aug 03 '20 at 16:09
  • You can configure Git as to what remote-tracking names you care about, and have it not bother creating and maintaining the rest; the linked question is mostly about that. – torek Aug 03 '20 at 16:09

0 Answers0