Technically, there is special handling for both "master" and "main" in Git in fairly obvious, but I'd argue in a not very important way. When you merge two regular branches, the commit message is `Merge branch 'source' into destination`. But not if destination is `master` or `main` – the `into ...` part is omitted for those merge commits.
But this is just for backward compatibility. Git is very conservative in changing such user facing behavior as generated merge commit messages. To get Git to treat `master` and `main` truly without special handling, set empty value to config option `merge.suppressDest` [1]:
$ git config merge.suppressDest ""
`master` is also used as the default name for the default branch in newly created repositories. See option `--initial-branch` of `git init` and config variable `init.defaultBranch` [2] to override. Git for Windows, for example, allows setting the config option in its installer.Source code:
For merge commit formatting: https://github.com/git/git/blob/2108fe4a1976f95821e13503fd33...
For default branch naming: https://github.com/git/git/blob/91e2ab1587d8ee18e3d2978f2b7b...
Git for Windows installer suggesting setting `init.defaultBranch`:
- https://github.com/git-for-windows/build-extra/blob/586c46ec...
- https://github.com/git-for-windows/build-extra/blob/586c46ec...
Footnotes:
[1] https://git-scm.com/docs/git-merge#Documentation/git-merge.t...
[2] https://git-scm.com/docs/git-init#Documentation/git-init.txt...