Could not symlink share/doc/git-doc/MyFirstContribution.html
Target /opt/homebrew/share/doc/git-doc/MyFirstContribution.html
is a symlink belonging to git. You can unlink it:
brew unlink git
To force the link and overwrite all conflicting files:
brew link --overwrite git
To list all files that would be deleted:
brew link --overwrite git --dry-run