I am trying to write a git deployment script, but the script must update multiple servers, and they are not all in the same git branch. Ideally, a script should only need one command, resulting in "git reset --hard origin / whateverBranchThisServerIsOn".
Now I understand what I can do:
git reset
to reset my git for remote branch foo. However, what I would like to do is reset for the remote branch, but not โfooโ specifically, just โremote from any branch that the machine is currently checking (i.e. which branch appears when you do git branch โ .
I tried:
git reset
and
git reset
and
git reset
but they all either check other branches, or (in the latter case) do not receive remote commits. Of course, is there a way to say git reset --hard origin/CURRENT_BRANCH ?
source share