Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Git: Support git history in VSCode #68

Closed
luisrudge opened this issue Nov 18, 2015 · 35 comments
Closed

Git: Support git history in VSCode #68

luisrudge opened this issue Nov 18, 2015 · 35 comments
Labels
feature-request Request for new features or functionality git GIT issues
Milestone

Comments

@luisrudge
Copy link

It would be awesome to be able to squash commits right from the UI too

@joaomoreno joaomoreno changed the title add ability to view commit history inside vscode Git history in VSCode Nov 25, 2015
@joaomoreno joaomoreno added the feature-request Request for new features or functionality label Nov 25, 2015
@egamma egamma modified the milestone: Backlog Dec 10, 2015
@massimocode
Copy link

It would be great if we could right click a file and see the Git history for the file. If anyone knows of a nice OS X client that will allow me to easily find a file and view the history then let me know! I've found out how to do it on SourceTree but it's way too fiddly, and GitHub for Mac doesn't have such a feature.

@egamma
Copy link
Member

egamma commented Dec 21, 2015

@massimocode just wondering would an action to open the file on github and then view the history there cover your needs? For example there is an open in github extension https://marketplace.visualstudio.com/items/ziyasal.vscode-open-in-github

@luisrudge
Copy link
Author

@egamma that works, but vscode's diff is waaaaaaaaay better than github :) Also, it would be awesome to stay inside vscode to do that

@massimocode
Copy link

@egamma Hey Erich, thanks for the reply. Unfortunately we're not using GitHub, we're using Stash. It would be great if VSCode has inbuilt support for viewing source control history, like Visual Studio, although I can appreciate it would be a large effort!

It also enables viewing history offline, which is great and leverages one of the main benefits of distributed source control.

@egamma
Copy link
Member

egamma commented Dec 22, 2015

Valid points CC @chrisdias

@ryanheath
Copy link

How about an interactive history view, something like git extentions (http://gitextensions.github.io/ ) would be cool!

@egamma
Copy link
Member

egamma commented Feb 10, 2016

There is now a git history extension available that you can try: https://marketplace.visualstudio.com/items?itemName=donjayamanne.githistory

@ryanheath
Copy link

Yeah, has seen that one before, but its functionality is too limited.

@massimocode
Copy link

@egamma Thanks this extension is exactly what I was looking for!

@Spown
Copy link

Spown commented May 17, 2016

the extension is definitely better than nothing, but it's really is more like a makeshift solution. I still use SmartGit's log:

for history tracking. It would be cool if VSCode would steal get something comparable - with a separate interface and functionality to revert, blame, see what's in the other branches without actually switching them...

@DonJayamanne
Copy link
Contributor

@massimocode , the githistory extension https://marketplace.visualstudio.com/items?itemName=donjayamanne.githistory now supports:

  • Viewing history by right clicking on a file in the explorer
  • Graphical view of git history

Will update it some time soon with a few more features.
Image

@LiuJoyceC
Copy link

Is there any way using that extension (or any other extension available) to view the diff between two branches? When there's a long commit history with a lot of different contributors and various branches, it's very tedious to go find out which commit corresponds to a given branch, and then scroll through the commit history to find that commit. Even when commit messages shown, it's difficult to keep track which commit is the latest on a given branch.

This git command is very simple and straightforward and does exactly what I want:

  1. git diff origin/master HEAD
  2. git diff my-feature-branch (diffs against current working copy)
  3. git diff origin/release-branch-1.2.3 origin/release-branch-1.2.4
  4. git diff f38ab2e
  5. git diff f38ab2e df09c47
  6. git diff (between working copy and HEAD)

Unfortunately, the output in the command line is difficult to read and navigate through, so I would love to have the above functionality but be able to view it in VSCode's diff. I find VSCode's diff output to be easy to read, but right now it seems to be limited to only option 6 above. The Git History extension allows me to perform option 4 and 5 above as well, but that is still very limited, as I have to know which commits I want to compare (and the only way to compare a branch is to go separately find out the latest commit on that branch). Perhaps there is a way to do what I want in the extension and I just haven't found that functionality, but I don't know because documentation for the extension is almost non-existent. If anyone here knows how you can compare branches using the extension (or another existing extension) I would love to know.

Currently, my only workaround is to also open my local repo in IntelliJ (since it has built-in functionality to compare any branches or commits) while working in VSCode, so I have to have two IDEs open at once. Given that this functionality is already built into Git with the straightforward git diff command, I'm surprised that there isn't already a VSCode extension built on it that simply renders the diff command output in the VSCode diff.

@DonJayamanne
Copy link
Contributor

DonJayamanne commented Aug 5, 2017

I have added some preliminary (needs a lot of polishing) support for diff between commits (branches) in the latest release.
Also making use of the new treeview (explorer) to display the commit information.
Image of Compare

@DonJayamanne
Copy link
Contributor

@MikeGitb

@DonJayamanne: Does your extension also allow for a more concise visual style that is more suited for for a desktop system?

Sorry, the answer is no. You might want to try other tools such as GitKraken (this too is built on topp of Electron, just like VS Code) or the like.

@heisian
Copy link

heisian commented Sep 13, 2017

It was actually this extension that gave me what I was looking for:
https://marketplace.visualstudio.com/items?itemName=huizhou.githd

@JacobJT Side-by-side Git Diff between branches:
screen shot 2017-09-13 at 8 54 23 am

@JediLuke
Copy link

JediLuke commented Dec 4, 2017

Check out this extension, it's everything I wanted in a merge compare tool https://marketplace.visualstudio.com/items?itemName=letmaik.git-tree-compare#review-details

@doudou
Copy link
Contributor

doudou commented Dec 8, 2017

There's also https://marketplace.visualstudio.com/items?itemName=eamodio.gitlens ... really REALLY neat.

@webdeveloper0429
Copy link

in gitlab, we can see branch's commits list
if we click one commit, then we can see what is changed(there is view side-by-side).

is there same functionality in gitlens?

thanks in advance

@c1ee
Copy link

c1ee commented Apr 12, 2018

Having moved from Windows to Mac, Git Extensions is the one thing I miss every day. If VS Code could replicate that experience it would make my day.

@elAndyG
Copy link

elAndyG commented Sep 5, 2018

@starcraft0429 this is a late response, but yes, GitLens extension has side by side view (July 2018)

https://github.com/eamodio/vscode-gitlens/#powerful-comparison-tools

When comparing two branches, it lists the files with diffs. You can then select the individual files and see a side by side comparison between the branches.

Steps to take:

  1. Click GitLens icon (to the left)
  2. Open branches node in Explorer Tree.
  3. right-click a branch > Select For Compare
  4. right-click another branch > Compare With Selected

In the RESULTS section, there will be a node with # files changed. You can a listed file and get a side-by-side diff.

@joaomoreno joaomoreno changed the title Git history in VSCode Git: Support git history in VSCode Sep 17, 2018
@domoritz
Copy link

Sublime merge (https://www.sublimemerge.com/) was just released and it a view that could be nicely integrated into vscode.

screen shot 2018-09-24 at 17 53 51

What I really like in this screenshot is the history on the left. At a a glance I can see other branches, how many files have been edited in each commit, and what has been pushed. I think that adding a simple history view like this would be a powerful addititon to VSCode.

What do people think? Would adding a view like this with some basic options on right click be what you want for this feature request?

@shane-smith
Copy link

For anyone looking for an alternative / workaround - I'll repeat what a few people have said so far: try the GitLens extension. It adds a significant amount of extra functionality and I use it constantly while working.

@kanlukasz kanlukasz mentioned this issue Mar 11, 2019
@kanlukasz
Copy link

Alternatives are not a problem, but i think its should be native option.
If VS Code offers git, it should offer all important git options (in fact git log that is)

@georgyfarniev
Copy link

I also think that vs code really need to support this option. For most cases it's the only missing option in vs code git support, and there's no good plugin to do this thing. Since VS code already have git support, it makes sense to add history as well. Looking forward to uninstall source tree from my workstation.

@joaomoreno joaomoreno self-assigned this Oct 9, 2019
@SupinePandora43
Copy link

SupinePandora43 commented Oct 19, 2019

https://marketplace.visualstudio.com/items?itemName=mhutchie.git-graph looks like git history

@georgyfarniev
Copy link

https://marketplace.visualstudio.com/items?itemName=mhutchie.git-graph looks like git history

Great plugin! Thank you. Finally it’s time to uninstall sourcetree. Would be great to have it out of the box in vs code. Git log is a vital thing and since vs code supports git, history should be supported too IMO. It’s integrity.

@gjsjohnmurray
Copy link
Contributor

The Timeline preview in 1.42 is relevant to this issue.

https://code.visualstudio.com/updates/v1_42#_timeline-view

@jasonwilliams
Copy link
Contributor

Git Lens (made by @eamodio) now let’s you rebase and squash commits in the UI, which I believe satisfies the original issue raised.

@lramos15
Copy link
Member

lramos15 commented Jul 1, 2021

As @jasonwilliams said, GitLens now supports this. You can download Gitlens for more advanced git features in VS Code https://marketplace.visualstudio.com/items?itemName=eamodio.gitlens

@lramos15 lramos15 closed this as completed Jul 1, 2021
@heartacker
Copy link
Contributor

'git graph' will be better

@github-actions github-actions bot locked and limited conversation to collaborators Aug 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality git GIT issues
Projects
None yet
Development

No branches or pull requests