Phabricator should recognize "Bug: Tnnn" in commit messages same as "refs Tnnn" and connect the commit to the task.
While it's possible to configure various prefixes/suffixes to do things, such as "fixed Tnnn" to resolve the task, using maniphest.statuses, "refs" and some other ones are hardcoded in ManiphestTaskStatus::getStatusPrefixMap(). https://secure.phabricator.com/T5586 is the upstream request to make them configurable.
(T55387 is vaguely related.)