Skip to content

Git warning about 'master' branch appears during cloud deployment despite global config #2486

Open
@geverit4

Description

Description

During the Frappe cloud deployment process, Git displays a warning message about using 'master' as the initial branch name, even when users have configured their global Git settings to use 'main' as the default branch (git config --global init.defaultBranch main).

This occurs during the automated deployment process when cloning with a specific commit hash:

Technical Details

The warning appears because the deployment script performs a clone operation with a specific commit hash, which creates a temporary branch using Git's built-in defaults rather than respecting the user's global settings.

Current output includes:

  1. Creation of empty repo
  2. Creation of temporary 'master' branch (triggering warning)
  3. Switch to 'main' branch
  4. Checkout of specific commit (detached HEAD state)

Impact

While this doesn't affect deployment functionality, it creates unnecessary warning messages in logs and could cause confusion for users who have explicitly set their default branch to 'main'.

Suggested Solutions

  1. Modify the clone command to explicitly specify the branch name using -b main
  2. Or restructure the deployment process to:
    • First clone the repository normally
    • Then checkout the specific commit hash

Environment

  • Platform: Frappe Cloud
  • Operation: Automated deployment process

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions