Code and repositories / Repository settings
Change the description or the default branch
The home page of your repository says nothing about it, or the Code tab opens the wrong branch. Change both under General in the settings.
2 min read
You need the maintain role or more on the repository.
1. Open General
Open the repository, then Settings. The General section opens.
If the repository has no description, people who can manage it see Add a description and topics under About, in the sidebar of the home page. Click it to open the description field.
2. Change the fields
- Description: the text that About shows on the home page.
- Default branch: the branch that the Code tab shows first. Other branches and new pull requests compare against it.
3. Save
Click Save in the bar at the bottom.
Change them in a terminal
src repo edit --description "The API of Acme" --default-branch main
A default branch that does not exist is refused.
Done
About on the home page shows your description, and the Code tab opens your default branch.
People with the maintain role or more also set the link preview of the repository. This preview is the title, the text and the image that X, Slack and Discord show for a link. See Show a good link preview.
With REST or MCP
An agent or a script changes both with PATCH /api/v1/repos/{owner}/{repo}, or with the MCP tool update_repo.