简体   繁体   English

如何在VsCode中将当前分支的文件与给定提交中的文件进行比较?

[英]How do you compare file of current branch with file in given commit in VsCode?

I'm working on a project on a given branch in VSCode, and want to compare my current file with the contents of the same file in a previous commit on a different branch. 我正在VSCode中给定分支上的项目上进行工作,并希望将我的当前文件与先前在不同分支上提交的同一文件的内容进行比较。 I think I can do this with the diff command, but I want to do it visually in VSCode. 我想我可以使用diff命令来做到这一点,但是我想在VSCode中直观地做到这一点。 Does anyone know how to do this? 有谁知道如何做到这一点?

I'm not really sure you can do that by default with VSCode. 我不确定在默认情况下是否可以使用VSCode做到这一点。 Or I don't know to do that too. 或者我也不知道那样做。
Currently, I use Git History extensions to do that. 目前,我使用Git History扩展来做到这一点。
I go to look on diff file, and click on Git History button on top and select the branch and commit where I want to diff with current file. 我去查看差异文件,然后单击顶部的Git历史记录按钮,然后选择分支并提交要与当前文件进行差异化的位置。

您可以使用GitLensGit历史记录

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 给定一个提交 id,如何确定当前分支是否包含该提交? - Given a commit id, how to determine if current branch contains the commit? 你如何在没有评论的情况下提交文件? - How do you commit a file without comments? 如何在给定提交到当前结帐时git合并文件? - How to git merge a file at given commit to current checkout? 在 GitHub 上,如何比较某个提交和当前分支的负责人? - On GitHub, how to compare between a certain commit and the current head of a branch? 如何在忽略合并的提交的同时查看在当前分支上进行的最后一次提交? - How do you view the last commit that was made on a current branch while ignoring commits that were merged in? 如果您已经将文件推送到远程分支,合并到开发分支并且它不是最新提交,如何从 git 中完全删除文件 - How to completely remove a file from git if you already pushed it to the remote branch, merged to the develop branch and it is not the latest commit git:如何进行提交,以使当前分支与另一个分支相同? - git: how to do a commit so that the current branch is the same as another branch? 使用 emacs(和 magit?)访问给定提交/分支/等中的文件 - Using emacs (and magit?) to visit a file in given commit/branch/etc 如果删除了远程分支,如何删除远程提交? - How do you delete a remote commit if you deleted a remote branch? 我如何查看不同分支中文件的提交历史而不检查该分支? - How do I view of commit history of file in different branch without checking out that branch?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM