I've got a local branch called deployment
. This branch is also on origin
. How do I reset the local deployment branch to the state of origin
's deployment branch?
Something like the following:
git fetch origin
git reset --hard origin/deployment
Would that be possible?
That's correct, but be careful - git reset --hard
throws away all uncommitted changes, i.e. those just in your working tree or the index (staging area). Also, just make sure that you really are on the deployment
branch with git checkout deployment
, since git reset
always changes the position of the current branch, i.e. the one that HEAD
points to.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With