![]() ![]() That change is currently being discussed on our mailing list. Also, consistent with its project governance, Git has undertaken a community process to explore changing the name of the first branch created automatically for new repositories away from ‘master’. We support and encourage projects to switch to branch names that are meaningful and inclusive, and we'll be adding features to Git to make it even easier to use a different default for new projects.Īs a first step, Git will add a mechanism to allow users to specify the default used as the name of the first branch when creating a new repository. Thus many projects use it to represent the primary line of development. Offensive to some people and we empathize with those hurt by the use of that term.Įxisting versions of Git are capable of working with any branch name there's nothing special about ‘master’ except that it has historically been the name used for the first branch when creating a new repository from scratch (with the git init command). Works as intended, and the repo is pushed to GitHub.Both Conservancy and the Git project are aware that the initial branch name, ‘master’, is I can do that with git branch -M and explicitly supplying it as : $ git branch -M master mainĪfter this is done, the command $ git push -u origin main ![]() Lacking guidance from GitHub, I must assume that this is what they want me to rename "main". Instead, I have a file refs/heads/master: $ ls -A1h refs/heads/ In my case, the returned filepath refs/heads/trunk does not exist. Again, an authoritative confirmation of this would be awesome.Īccording to its documentation, git symbolic-ref returns the filepath associated with the symbolic reference "HEAD". Since the error I got trying to follow GitHub's instructions cites refs/heads/trunk explicitly, I further assume that git branch calls git symbolic-ref HEAD in order to determine the current branch. This makes enough sense to assume, though an authoritative source would still be then suggests several ways of determining the current branch. Am I allowed to know how git branch -M handles a single suggests that git branch implicitly takes to be the current branch if it's not provided as part of the command. Knowing this would help me figure out what causes the error I get and how to fix it. I assume that there's some secret algorithm that git branch uses to determine what it should use for. With no explanation of what happens when is not specified. If exists, -M must be used to force the rename to happen. If had a corresponding reflog, it is renamed to match, and a reflog entry is created to remember the branch renaming. With a -m or -M option, will be renamed to. I assume, because no one involved can be bothered to make clear, that this one argument is. Here, however, GitHub has given me only a single argument. The standard command for this is of the form $ git branch -M The -M flag to git branch is a combination of -m (move) and -f (force) to forcibly rename a branch. When I execute them, I get an error at the git branch step: $ git remote add origin Įrror: refname refs/heads/trunk not found After creating a new repo on the site, GitHub gives the following instructions to execute locally: git remote add origin I'm trying to upload a local repo to GitHub. ![]()
0 Comments
Leave a Reply. |