-
Notifications
You must be signed in to change notification settings - Fork 282
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Respect git global config for a default branch #207
Conversation
init.defaultBranch:- Allows overriding the default branch name e.g. when initializing a new repository. https://git-scm.com/docs/git-config#Documentation/git-config.txt-initdefaultBranch
Thanks for your pull request to Laravel! Unfortunately, I'm going to delay merging this code for now. To preserve our ability to adequately maintain the framework, we need to be very careful regarding the amount of code we include. If possible, please consider releasing your code as a package so that the community can still take advantage of your contributions! If you feel absolutely certain that this code corrects a bug in the framework, please "@" mention me in a follow-up comment with further explanation so that GitHub will send me a notification of your response. |
@taylorotwell This is not a "feature" I can release as a package. Laravel installer SHOULD respect my git global configuration for my "master/main" branch. Otherwise I'm forced to always pass the branch argument which is not nessasery. Please, respect git configuration |
How does this PR behave if Git isn't installed? |
It will default to |
|
||
$output = trim($process->getOutput()); | ||
|
||
return $process->isSuccessful() && $output ? $output : 'main'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@taylorotwell If the process is not successful, it will default to main
Git provides a global configuration to override the default branch when a new repository is initialized.
Even though laravel/installer provides a way to override the default branch name, laravel/installer does respect git global configurations.
init.defaultBranch:- Allows overriding the default branch name e.g. when initializing a new repository.