After cloning a repository I cannot reset that repository's state to a remote branch.
$ git clone <repo>
$ git reset --hard <upstream branch>
fatal: ambiguous argument '<upstream branch>': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]
What works fine is either prefixing with origin
$ git reset --hard origin/<upstream branch>
or do a checkout before
$ git checkout <upstream branch>
$ git reset --hard <upstream branch>
Questions:
- What extra information or state change does the checkout command provide to the local git repository so that it eventually can reset its state?
- Is there a command (like checkout) I can run before the reset command that is not branch specific?