NoDefaultBranchException error regarding the default branch - this branch does not exist
The following appears in the
2013-01-16 09:36:06,547 ERROR [http-bio-8443-exec-13] XUE2 576x1711x1 hdxjye 10.16.214.10 "GET /projects/INFENG/repos/inspircd/browse HTTP/1.1" c.a.p.web.DefaultWebInterfaceManager Could not evaluate condition 'com.atlassian.plugin.web.conditions.AndCompositeCondition@3c9147c1' for descriptor: com.pirateninjaunicorn.stash.readme-parser:readmeParserTab (Tab in repository view) com.atlassian.stash.exception.NoDefaultBranchException: refs/heads/master is set as the default branch, but this branch does not exist ...
Some projects do not use "master" as their development branch, preferring to use "trunk" or "development" instead. Such repositories may not even have a "master" branch. However, git's default behavior is for
HEAD to point to
refs/heads/master, which results in a pretty unpleasant user experience when browsing a repository in Stash. When navigating to the "Files" or "Commits" tabs, Stash displays a warning indicating the default branch does not exist, and the user then has to go select a different branch. Setting the default branch allows Stash to display a useful initial branch, rather than a warning.
Setting the default branch in Stash has only limited control over what you will receive when you clone the repository, due to how git's wire protocol works. The real purpose of the feature is to allow users to control which branch is selected by default in the branch selector.
- Navigate to the affected Repository.
- Click on "Settings".
- Under "General Settings" modify the "Default Branch" accordingly.