Git Fetch
Helps you to get known about the latest updates from a git repository
. Let's say you working in a team using GitFlow
, where team working on multiple branches
( features ). With git fetch --all
command
you can get known about all new branches
within repository
.
Mostly git fetch
is used with git reset
. For example you want to revert all your local changes to the current repository state.
git fetch --all // get known about latest updates
git reset --hard origin/[branch] // revert to current branch state
Git pull
This command update your branch
with current repository
branch
state. Let's continue with GitFlow
. Multiple feature branches
was merged
to develop
branch and when you want to develop new features for the project you must go to the develop branch
and do a git pull
to get the current state of develop
branch
Documentation for GitFlow https://gist.github.com/peterdeweese/4251497