How to reset ‘master’ to ‘origin/master’

git

Can I do the following in a simpler way?

git checkout origin/master
git branch -D master
git branch master
git checkout master

Best Answer

Git supports this command:

git checkout -B master origin/master

Check out the origin/master branch and then reset master branch there.

Related Question