Skip to content

Conversation

@AlvaroParker
Copy link
Contributor

Adds a git clone open listener to clone and open repos using zed zed://git/clone/<url> .

This will also allow creating "Open with Zed" buttons on websites with a href to something like zed://git/clone/https://github.com/zed-industries/zed.git.

Demo:

2025-10-31.14-43-16.mp4

Release Notes:

  • Added git clone open listeners using zed://git/clone/<git-url>

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Oct 31, 2025
@Angelk90
Copy link
Contributor

Angelk90 commented Nov 1, 2025

@AlvaroParker : Would it be possible to do something like this?
zed zed://git/clone/<url> --single-branch
zed zed://git/clone/<url> --single-branch -b feature-a

look: https://git-scm.com/docs/git-clone#_options

@AlvaroParker
Copy link
Contributor Author

@Angelk90 Currently the git clone backend implementation doesn't support that (single branch, -b argument, etc), and adding that I think is out of scope for this PR

zed/crates/fs/src/fs.rs

Lines 962 to 978 in 07dcb8f

async fn git_clone(&self, repo_url: &str, abs_work_directory: &Path) -> Result<()> {
let output = new_smol_command("git")
.current_dir(abs_work_directory)
.args(&["clone", repo_url])
.output()
.await?;
if !output.status.success() {
anyhow::bail!(
"git clone failed: {}",
String::from_utf8_lossy(&output.stderr)
);
}
Ok(())
}

@AlvaroParker
Copy link
Contributor Author

I'll probably remove the cloning modal notification if #41712 gets merged

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

Labels

cla-signed The user has signed the Contributor License Agreement community champion

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants