Repository navigation
Tracking Issue: git integration #8665
Copy link
Copy link
Closed
Labels
area:integrations/gitGit integration feedbackGit integration feedbackignore top-ranking issuesthe script which generates Top-Ranking Issues lists (by upvotes) will ignore thisthe script which generates Top-Ranking Issues lists (by upvotes) will ignore thistrackingDEPRECATED label: use issue type 'Tracking' insteadDEPRECATED label: use issue type 'Tracking' instead
Description
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:
- A "git panel" similar to the VS Code one: Source control view panel #4367
- A diff view for things that changed: Show the diff between two arbitrary files #4523
- Ability to interact with git status gutter and undo changes: Show visual diff / rollback options when clicking changed lines indicator #4630
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
-
git blamein gutter, toggle on off - Addgit blame#8889 -
git blameinline in the editor - Inline git blame #10398 - More information in git blame tooltips
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 ...
- History (see: History commit #10807)
- ...
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area:integrations/gitGit integration feedbackGit integration feedbackignore top-ranking issuesthe script which generates Top-Ranking Issues lists (by upvotes) will ignore thisthe script which generates Top-Ranking Issues lists (by upvotes) will ignore thistrackingDEPRECATED label: use issue type 'Tracking' insteadDEPRECATED label: use issue type 'Tracking' instead
Activity
Moshyfawn commentedon Mar 1, 2024
I think #8663 can be added here.
jaskerv commentedon Mar 4, 2024
Can I add a feature request for a option to have
file changedin a tree view? 🙏justAdevTV commentedon Mar 6, 2024
I want git blame
uroybd commentedon Mar 14, 2024
Conventional commit support in
git commitwill 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
taunusflieger commentedon Mar 16, 2024
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.
savoygrizzly commentedon Mar 18, 2024
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.
Ph0enixKM commentedon Mar 25, 2024
We could also have some form of Merge Editor like it is in Visual Studio Code or maybe something even better
fhamm commentedon Apr 16, 2024
It would also be great if the proposed source control view is compatible with git submodules, similar to VS Code =)
Moshyfawn commentedon Apr 22, 2024
@mrnugget you might want to link to #10807 where you mention the history milestone.
mrnugget commentedon Apr 24, 2024
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.
SomeoneToIgnore commentedon Apr 26, 2024
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.
indrajit-roy commentedon Apr 28, 2024
@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.
37 remaining items
Angelk90 commentedon Oct 22, 2024
@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.
mrnugget commentedon Oct 22, 2024
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.
Angelk90 commentedon Oct 22, 2024
@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 progressandcomplete.mrnugget commentedon Oct 23, 2024
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.
baldwindavid commentedon Oct 29, 2024
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" ], },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.
reslear commentedon Nov 6, 2024
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:
smergesudo ln -sv "/Applications/Sublime Merge.app/Contents/SharedSupport/bin/smerge" /usr/local/bin/smerge[ { "label": "Open repository in Sublime Merge", "command": "smerge $ZED_WORKTREE_ROOT", "reveal": "never" } ]Waiting for zed api to add items to the context menu or button in the footer
Credit:
andreacfromtheapp commentedon Dec 12, 2024
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
lorenzodejong commentedon Jan 7, 2025
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:
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.
idr4n commentedon Feb 14, 2025
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.
eugeneAtKnaufD commentedon Feb 24, 2025
For anyone wondering why this is no longer working, here is the workaround:
Gambloide commentedon Feb 25, 2025
After exiting lazygit with
q, this approach leaves an unclosable tab with the following contents on Linux:Neither clicking the
xin the tab switcher closes it, nor any keyboard shortcuts likectrl-w,ctrl-d,ctrl-c, etc.I had to add
"hide": "on_success"to the task to work around this issue with the workaround:JosephTLyons commentedon Feb 27, 2025
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.
maxbrunsfeld commentedon Mar 12, 2025
This shipped.