Skip to content

git: Add git clone open listener#41669

Merged
agu-z merged 10 commits intozed-industries:mainfrom
AlvaroParker:git-clone
Dec 19, 2025
Merged

git: Add git clone open listener#41669
agu-z merged 10 commits intozed-industries:mainfrom
AlvaroParker:git-clone

Conversation

@AlvaroParker
Copy link
Contributor

@AlvaroParker AlvaroParker commented Oct 31, 2025

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

This will also allow creating "Open with Zed" buttons on websites with a href to something like zed://git/clone?repo=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?repo=<git-url>

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Oct 31, 2025
@github-actions github-actions bot added the community champion Issues filed by our amazing community champions! 🫶 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

@agu-z agu-z moved this from Community Champion PRs to In progress in Quality Week – December 2025 Dec 18, 2025
@agu-z
Copy link
Contributor

agu-z commented Dec 18, 2025

@AlvaroParker Thank you for contribution! Merging after these tweaks:

  • Switched to a format consistent with zed://git/commit
  • Wait for the workspace window to appear before opening the path prompt, so that it the former doesn't appear over it when a tiling wm isn't used
  • Reused clone flow from git panel

@agu-z agu-z enabled auto-merge (squash) December 18, 2025 16:17
auto-merge was automatically disabled December 18, 2025 20:46

Head branch was pushed to by a user without write access

@AlvaroParker
Copy link
Contributor Author

Hey @agu-z thanks for those tweaks! I fixed the redundant clone and now tests should pass.

@agu-z agu-z merged commit 63c4406 into zed-industries:main Dec 19, 2025
24 checks passed
@github-project-automation github-project-automation bot moved this from In progress to Done in Quality Week – December 2025 Dec 19, 2025
rtfeldman pushed a commit that referenced this pull request Jan 5, 2026
LivioGama pushed a commit to LivioGama/zed that referenced this pull request Jan 20, 2026
LivioGama pushed a commit to LivioGama/zed that referenced this pull request Jan 20, 2026
LivioGama pushed a commit to LivioGama/zed that referenced this pull request Feb 15, 2026
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 Issues filed by our amazing community champions! 🫶

Projects

Development

Successfully merging this pull request may close these issues.

5 participants