When working with git, before starting work on a feature or an issue, I would do following steps
git checkout master // make sure you are on local master
git fetch origin // get latest commits from remote
git merge origin/master // merge latest commits from remote into local master
git checkout -b new-branch // create new branch from up-to-date remote master
However, I am reading Atlassian tutorial for feature-branch workflow, and they suggest doing following
git checkout master
git fetch origin
git reset --hard origin/master
git checkout -b new-branch
Obviously, except step 3, we follow identical steps. But as new git user, I am confused with step 3 even after I read explanation of what it does.
What is different btw my and their step 3? Which and why is better?