I have a remote repo on github, and on my local machine I have a few different branches (so I can switch between the branches using "git checkout master
", "git checkout branch2
", etc.).
When I run the "git fetch
" command, I am never sure if it's fetching updates for ALL of those branches or ONLY the branch I'm currently working in (the one I most recently "checkout"'ed).
In other words, if I'm working in branch2
and want merge in changes someone else made to branch1
, do I need to do:
git checkout branch1
git fetch
git checkout branch2
git merge branch1
Or can I just do this:
git fetch
git merge branch1