Visitar URL original
Tracking Issue: git integration · Issue #8665 · zed-industries/zed · GitHub
Skip to content

Tracking Issue: git integration #8665

Closed
Closed

Description

@mrnugget

Problem

Our current git integration is very minimal. What we have:

  • showing current branch, selecting branches
  • showing git status in gutter, until changes are staged
  • showing git status in project panel
  • navigating to previous/next hunk

Many users are asking for more git integration:

Goal

Build a 0.1 of git integration that fixes immediate pain points and stops users from leaving Zed to go to GitHub, GitLab, or another editor to use a git feature.

The most common git interactions should be doable inside Zed: committing, staging, unstaging, viewing diffs, ...

They should allow keyboard-only workflow.

Current status

Work on git integration is paused at the moment, since we're spread too thin on a lot of other projects.

Roadmap

Ranking here very subjective and based on personal pain points.

Milestone 1 - git blame

Milestone 2 - git diff

  • Support diffs
    • Allow opening diffs from git status view

Milestone 3 - git status & git commit

  • git status view
    • see: working directory is clean or dirty
    • see: untracked, unstaged, staged files
    • do: stage/unstage files
  • git commit
    • triggered from git status view
    • opens git commit message

Things we have to do

  • Support opening sub-folders (or single files) of git repositories

Milestone ...

Activity

  1. Moshyfawn commented on Mar 1, 2024

    @Moshyfawn
    Contributor

    I think #8663 can be added here.

  2. jaskerv commented on Mar 4, 2024

    @jaskerv

    Can I add a feature request for a option to have file changed in a tree view? 🙏

  3. justAdevTV commented on Mar 6, 2024

    @justAdevTV

    I want git blame

  4. uroybd commented on Mar 14, 2024

    @uroybd

    Conventional commit support in git commit will be great.

    Alternatively, we can allow plugins to take care of these things like this one: https://marketplace.visualstudio.com/items?itemName=vivaxy.vscode-conventional-commits

  5. taunusflieger commented on Mar 16, 2024

    @taunusflieger

    Would be nice if you work in a folder below the git root and get ask if you want to locate the repo (as it is done in vscode). Currently if you are not opening the git root, but a sub directory git support is not enabled.

  6. savoygrizzly commented on Mar 18, 2024

    @savoygrizzly

    Just wanted to drop in there that the new git integration should allow for multiple git's inside an open folder, I like to be able to have my container open so I can work on multiple services at the same time.

  7. Ph0enixKM commented on Mar 25, 2024

    @Ph0enixKM
    Contributor

    We could also have some form of Merge Editor like it is in Visual Studio Code or maybe something even better

  8. fhamm commented on Apr 16, 2024

    @fhamm

    It would also be great if the proposed source control view is compatible with git submodules, similar to VS Code =)

  9. Moshyfawn commented on Apr 22, 2024

    @Moshyfawn
    Contributor

    @mrnugget you might want to link to #10807 where you mention the history milestone.

  10. mrnugget commented on Apr 24, 2024

    @mrnugget
    ContributorAuthor

    Update here: we're going to pause work on the git integration for a few weeks, since we have a lot of projects going on right now — Tasks, Linux, remoting, AI — and are spread a bit too thin. Since we've reached a good pause-point here (just checked off Milestone 1), we'll pause work on git, focus on other projects for a while and then come back to git integration once we've finished other projects or reached significant milestones.

  11. SomeoneToIgnore commented on Apr 26, 2024

    @SomeoneToIgnore
    Contributor

    To soften the wait slightly, I hope to finish and merge #11080 that enabled git hunk diffs browsing in the editor.
    It's not a full diff view, but something useful still.

  12. indrajit-roy commented on Apr 28, 2024

    @indrajit-roy

    @mrnugget Can the community contribute to this? It would be nice to see the approach and design hosted somewhere so that interested folks can help speed up the process. I myself would like to switch to Zed permanently and am more than willing to help ship this asap. This is a huge and the only blocker for me right now.

  13. 37 remaining items

  14. Angelk90 commented on Oct 22, 2024

    @Angelk90
    Contributor

    Milestone 1

    @mrnugget : Where can I find the Milestone developments, on https://github.com/zed-industries/zed/projects?query=is%3Aopen
    I can't find anything?

    Then the first Milestone goals are already all complete for git.

  15. mrnugget commented on Oct 22, 2024

    @mrnugget
    ContributorAuthor

    Not sure what you're after, but we didn't tag all issues/PRs for this milestone. It was a manual process to check off the checkboxes here.

  16. Angelk90 commented on Oct 22, 2024

    @Angelk90
    Contributor

    Not sure what you're after, but we didn't tag all issues/PRs for this milestone. It was a manual process to check off the checkboxes here.

    @mrnugget : Where can I see the milestone processes?
    For example, taking a repository that uses correctly, CE you can see in the current milestone which are todo, in progress and complete.

    Screenshot 2024-10-22 alle 19 01 12
  17. mrnugget commented on Oct 23, 2024

    @mrnugget
    ContributorAuthor

    Like I said, we didn't use that. I just created that issue you see at the top and checked checkboxes off manually and linked to the relevant PRs.

  18. baldwindavid commented on Oct 29, 2024

    @baldwindavid
    Contributor

    For those that like TUIs, I use lazygit from within Zed and perhaps that can tide over some of those waiting for builtin functionality.

    The general idea is to set a keybinding that opens lazygit in a center terminal as another tab...

      {
        "bindings": {
          "cmd-g": [
            "workspace::SendKeystrokes",
            ": new center terminal enter lazygit enter"
            
            // Note: non-vim users would have to do something like below to open the command palette...
            // "cmd-shift-p new center terminal enter lazygit enter"
          ],
      },

    2024-10-29T183556@2x

    I do use and enjoy the already builtin blame features in Zed, but not sure I'd stop using lazygit even if advanced builtin functionality were to exist. Maybe a fancy UI for tricky merge conflict resolution, but that would be way off in the future and I tend to crack open Sublime Merge for that anyway.

  19. reslear commented on Nov 6, 2024

    @reslear
    Contributor

    Maybe a fancy UI for tricky merge conflict resolution, but that would be way off in the future and I tend to crack open Sublime Merge for that anyway.

    By the way, maybe someone knows how to implement the function
    “Open repository in Sublime Merge” as in https://github.com/giovdk21/vscode-sublime-merge ?


    Ok, my solution:

    1. Setup smerge
    sudo ln -sv "/Applications/Sublime Merge.app/Contents/SharedSupport/bin/smerge" /usr/local/bin/smerge
    1. Add task "zed: open project tasks" :
    [
      {
        "label": "Open repository in Sublime Merge",
        "command": "smerge $ZED_WORKTREE_ROOT",
        "reveal": "never"
      }
    ]
    1. "task: spawn"

    Waiting for zed api to add items to the context menu or button in the footer

    Credit:

  20. andreacfromtheapp commented on Dec 12, 2024

    @andreacfromtheapp

    Dear Zed developers,

    sorry to be adding to the list but I would immensely appreciate if Zed took a few hints from

    when addint this feature.

    Please and thamk you

    EDIT: this is a nice article with a great rationale https://matklad.github.io/2024/12/13/majjit-lsp.html

  21. lorenzodejong commented on Jan 7, 2025

    @lorenzodejong

    Specifically when having to perform merge conflicts i find myself switching back and forth between Zed and VS Code.

    I'm using lazygit for basic status, diff and commit history. However i noticed a couple shortcomings when using this workflow for resolving merge conflicts compared to using VS Code's inline conflict resolution:

    • In some cases it's desired to manually edit a merge conflict, specifically in scenarios where both the incoming and current branch contain relevant changes. In this case i usually "take both" and manually edit the change to the desired result. However this would require me to manually open the file after merging from lazygit, which is rather cumbersome.
    • Missing IDE type-safety, after choosing a conflict resolution i'm used to immediately seeing potential type errors arise in my IDE. This is also missing from this workflow.

    It would be amazing to have a UI within the Zed buffer to perform conflict resolution, as well as a git panel which displays files containing a merge conflict.

  22. idr4n commented on Feb 14, 2025

    @idr4n

    As another alternative, in addition to LazyGit and Sublime Merge mentioned already, recently discovered Gitu (not gitui), which is based on Magit but in the terminal, so it can be easily integrated in Zed as well.

  23. eugeneAtKnaufD commented on Feb 24, 2025

    @eugeneAtKnaufD

    For those that like TUIs, I use lazygit from within Zed and perhaps that can tide over some of those waiting for builtin functionality.

    The general idea is to set a keybinding that opens lazygit in a center terminal as another tab...

    {
    "bindings": {
    "cmd-g": [
    "workspace::SendKeystrokes",
    ": new center terminal enter lazygit enter"

        // Note: non-vim users would have to do something like below to open the command palette...
        // "cmd-shift-p new center terminal enter lazygit enter"
      ],
    

    },
    2024-10-29T183556@2x

    I do use and enjoy the already builtin blame features in Zed, but not sure I'd stop using lazygit even if advanced builtin functionality were to exist. Maybe a fancy UI for tricky merge conflict resolution, but that would be way off in the future and I tend to crack open Sublime Merge for that anyway.

    For anyone wondering why this is no longer working, here is the workaround:

    "bindings": {
        "cmd-g": ["task::Spawn", { "task_name": "Run Lazygit" }]
    }
    
    // and in tasks.json
    {
        "label": "Run Lazygit",
        "command": "lazygit",
        "use_new_terminal": true,
        "reveal_target": "center"
    }
  24. Gambloide commented on Feb 25, 2025

    @Gambloide

    For anyone wondering why this is no longer working, here is the workaround:

    "bindings": {
        "cmd-g": ["task::Spawn", { "task_name": "Run Lazygit" }]
    }
    
    // and in tasks.json
    {
        "label": "Run Lazygit",
        "command": "lazygit",
        "use_new_terminal": true,
        "reveal_target": "center"
    }

    After exiting lazygit with q, this approach leaves an unclosable tab with the following contents on Linux:

    ⏵ Task `Run Lazygit` finished successfully
    ⏵ Command: /bin/bash -i -c 'lazygit'
    

    Neither clicking the x in the tab switcher closes it, nor any keyboard shortcuts like ctrl-w, ctrl-d, ctrl-c, etc.

    I had to add "hide": "on_success" to the task to work around this issue with the workaround:

    // in ~/.config/zed/tasks.json
    [
        {
            "label": "Run Lazygit",
            "command": "lazygit",
            "use_new_terminal": true,
            "reveal_target": "center",
            "hide": "on_success"
        }
    ]
  25. added theissue type on Feb 27, 2025
  26. JosephTLyons commented on Feb 27, 2025

    @JosephTLyons
    Collaborator

    Hey everyone, just wanted to let you all know that we have opened a waitlist for our deeper git integration support here. We will be rolling the beta out very soon.

  27. maxbrunsfeld commented on Mar 12, 2025

    @maxbrunsfeld
    Collaborator

    This shipped.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:integrations/gitGit integration feedbackignore top-ranking issuesthe script which generates Top-Ranking Issues lists (by upvotes) will ignore thistrackingDEPRECATED label: use issue type 'Tracking' instead

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions