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 --hardthrows 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 thedeploymentbranch withgit checkout deployment, sincegit resetalways changes the position of the current branch, i.e. the one thatHEADpoints to.