4 ms·
I think I have it now: Both git fetch and ordinary git push update refs/remotes from refs/heads but they don't change anything under refs/heads at all. Ordina
by dreamcompiler 4y ago
I think I have it now:
Both git fetch and ordinary git push update refs/remotes from refs/heads but they don't change anything under refs/heads at all.
Ordinary git pull will update refs/heads/<currentbranch> because by default it merges/rebases the current branch after fetching, but that's not always desirable when branch switching is expensive.
Pushing locally updates refs/heads/<somebranch> from refs/remotes/<somebranch> without switching to that branch.
Now I also understand @myme's sentence "In fact, in order to properly “push to the local repository” it’s necessary to invoke a git fetch first to ensure that the remote tracking branches are updated."
Thanks to @myme and other responders in this thread!
- myme 4y agoYes! Right on the money! Thanks for coming back to state that it makes sense to you now.