Help with mac

i need help when i try to use terminal it keeps saying
error: Not a valid ref: refs/remotes/origin/master

fatal: ambiguous argument ‘refs/remotes/origin/master’: unknown revision or path not in the working tree.

Use ‘–’ to separate paths from revisions, like this:

‘git […] – […]’

/bin/bash -c “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)”

rm -rf "$(brew --repo homebrew/core)"

then

brew tap homebrew/core