![]() ![]() When we clone a repository, we have our Git reach out to some other Git. The problems are that it's loaded with jargon ( webster wikipedia), and abbreviates "source" to "src". This error message from Git is quite cryptic to newbies, but is actually pretty simple. If you have an earlier version of Git installed, or have already run git init, simply use git branch -m to rename master to whatever name you like.Įrror: src refspec main does not match any There are a bunch of other string literals reading master in the source and documentation as well they're being converted to use the configuration settings but this will all take time.ĢIf you have Git 2.28 or later, run git init -initial-branch= name, and/or set faultBranch with git config in your system or global configuration. (This is, in effect, what GitHub changed.) For a long time, Git has had, hard-coded into it, some code to stick the branch name master in there. This is the branch name that you're on, even if that branch name does not exist (yet). So Git stores some name in the symbolic ref named HEAD. However, you must be on some branch in this new empty repository. However, when you're on master, Git traditionally generates only a message of the form merge branch X.Ī new, empty repository created by git init has no commits and therefore has no branches (because a branch can only exist by having commits on it). Merging auto-generates a message of the form merge branch X into Y when you are on branch Y and run git merge X. As we know, technically correct is the best kind of correct, so let me add a few caveats in this footnote: For more about GitHub's changeover, seeĭifference Between Main Branch and Master Branch in Github?ġThere are some technical flaws in this kind of claim. But this leaves your Git and GitHub's Git out of sync, as it were. Meanwhile, GitHub have already chosen to leap ahead and make their default initial branch name main instead of master. Currently, you can do this manually during or after a git init, 2 but the project makes Git just do it automatically, without requiring a second step: If for any reason you want any other name by default, you can configure that. Git has traditionally used the name master here, but there is a project to make this configurable, so that if you are French or Spanish you can use the name principal or première or primero, or if you prefer Maori, you can use matua or tuatahi. ![]() 1 You could use main, master, trunk, or any other name as the name of your first branch. reconciling separate main and master branchesĮach of these is in its own section. ![]() ![]()
0 Comments
Leave a Reply. |