diff --git a/yazi-cli/src/package/git.rs b/yazi-cli/src/package/git.rs index ab6d97d9..3d1e85df 100644 --- a/yazi-cli/src/package/git.rs +++ b/yazi-cli/src/package/git.rs @@ -43,10 +43,17 @@ impl Git { } async fn exec(f: impl FnOnce(&mut Command) -> &mut Command) -> Result<()> { - let status = f(Command::new("git").args(["-c", "advice.detachedHead=false"])) - .status() - .await - .context("Failed to execute `git` command")?; + let status = f(Command::new("git").args([ + "-c", + "advice.detachedHead=false", + "-c", + "checkout.defaultRemote=origin", + "-c", + "clone.defaultRemoteName=origin", + ])) + .status() + .await + .context("Failed to execute `git` command")?; if !status.success() { bail!("`git` command failed: {status}");