Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

vamc19
Copy link
Contributor

@vamc19 vamc19 commented Dec 24, 2022

This PR adds a new configuration parameter DEFAULT_BRANCH which can be used to set the name of the default branch globally instead of changing the it for every repository. It defaults to "master" in order to remain backwards compatible. For new installs, it can be configured on the install page.

When creating a new repo, the bare repository will be initialized with the global default branch name. The commands on
the bare repo page will display the correct branch name.

Relates to/Fixes #6296

Checklist

  • I agree to follow the Code of Conduct by submitting this pull request.
  • I have read and acknowledge the Contributing guide.
  • I have added test cases to cover the new code.

This commit adds a new configuration parameter DEFAULT_BRANCH_NAME
which can be used to set the name of the default branch globally
instead of changing the it for every repository manually.

It defaults to "master" in order to remain backwards compatible.
For new installs, it can be configured on the install page.
When creating a new repo, the bare repository should be
initialized with the global default branch. The commands on
the bare repo page should display correct branch name.
@vamc19 vamc19 changed the title Default branch Set default branch name Dec 24, 2022
@unknwon unknwon self-requested a review February 11, 2023 07:06
@unknwon unknwon self-assigned this Feb 11, 2023
@codecov
Copy link

codecov bot commented Feb 11, 2023

Codecov Report

Merging #7291 (4606069) into main (8350daf) will decrease coverage by 0.01%.
The diff coverage is 0.00%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7291      +/-   ##
==========================================
- Coverage   14.61%   14.60%   -0.01%     
==========================================
  Files         108      108              
  Lines       13864    13872       +8     
==========================================
  Hits         2026     2026              
- Misses      11563    11571       +8     
  Partials      275      275              

Copy link
Member

@unknwon unknwon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@unknwon unknwon changed the title Set default branch name conf: add new config option for default branch name Feb 11, 2023
@unknwon unknwon merged commit ef1fe1b into gogs:main Feb 11, 2023
@vamc19 vamc19 deleted the default-branch branch February 14, 2023 06:59
dna2github pushed a commit to dna2fork/gogs that referenced this pull request May 1, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Recognize main as default branch if master is not available
2 participants