It seems that the issue you’re facing is related to the default branch name used by Git and Egit in Eclipse. Before Git 2.28, the default branch name was “master,” but since then, Git has moved towards using “main” as the default branch name to promote more inclusive language.
Egit in Eclipse might not have adopted this change automatically, which is why it’s still creating a “master” branch by default when initializing a new repository. The default branch name is specified in the Git configuration file, which you observed with the git config --list --show-origin command.
To address this issue, you can manually change the default branch name in Egit’s configuration to “main” instead of “master.” You can do this by executing the following command in your Git repository:
git config --local init.defaultBranch main
This command sets the default branch for your current repository to “main.” Additionally, you can change the global Git configuration to use “main” as the default branch for all repositories you create:
git config --global init.defaultBranch main
By updating the default branch name in the Git configuration, Egit should now create new repositories with “main” as the default branch instead of “master.”
As for the “HEAD” file containing “ref: refs/heads/master,” it is expected if your current branch is still called “master.” However, after you set the default branch to “main” using the configuration commands, any new repositories should have “main” as the default branch, and the “HEAD” file will reference that instead.
If you encounter any issues or if Egit behaves differently, seeking help in a Git forum is a reasonable step, as Git experts might have more specific insights into Egit’s behavior and potential workarounds.
Perhaps I misunderstand something. As I said previously, I think that init.defaultBranch is already main for the two configuration files in my system. I think that is the situation. If I understand things then main should be the default.
Except as best as I understand, it is not doing that.