Resolving Git Executable Error in Branch Deployment Code Locations
Last updated: November 10, 2025
This article helps resolve deployment errors related to missing git executable when using branch deployment code locations in Dagster.
Problem Description
Users experience deployment failures when deploying branch-deployment code locations due to a missing or improperly configured git executable. This is a known issue that affects the dagster-dbt integration when it attempts to initialize git repositories.
Symptoms
DagsterImportErrorwith message"Failed to initialize: Bad git executable"Error occurs during code location deployment, specifically when importing
dagster-dbtmodulesStack trace shows failure in
git/__init__.pywhen trying to refresh git executableDeployment worked previously but suddenly started failing without configuration changes
Root Cause
This is a known issue in Dagster where the git executable is not properly available in the deployment environment. The dagster-dbt integration requires git to be accessible, but the deployment environment may not have git installed or properly configured in the PATH.
Solution
Pin your Dagster version to avoid the problematic version until the fix is released.
Step-by-Step Resolution
Identify your current Dagster version and pin to a stable version in your requirements.txt or
pyproject.toml:dagster==1.8.x # Replace x with the last working versionRedeploy your code location with the pinned version
Verify the deployment completes successfully without git executable errors
Alternative Solutions
If pinning the version doesn't work, you can try setting the GIT_PYTHON_REFRESH environment variable to suppress the error:
export GIT_PYTHON_REFRESH=quietPrevention
Monitor Dagster release notes for updates on this issue and upgrade to newer versions once the fix is available. Consider testing deployments in a staging environment before promoting to production.
Related Documentation