简体   繁体   English

我如何查看不同分支中文件的提交历史而不检查该分支?

[英]How do I view of commit history of file in different branch without checking out that branch?

有什么方法可以强制“ git log”从其他分支读取提交历史记录?

You can use 您可以使用

git whatchanged branch filename

to get an overview of all the commits in which the file was changed in that branch. 以获得该分支中更改了文件的所有提交的概述。 And

git whatchanged -p branch filename

will give you detailed diffs of that file for each commit. 将为您提供每次提交该文件的详细差异。

只需输入“ git log branchname-filename”即可。

You can checkout a different branch without committing the branch you're currently in by using 您可以使用签出其他分支,而无需提交当前所在的分支

git checkout <<branchname>> -f

I am fairly sure that this will not affect your current (uncommited) branch 我相当确定这不会影响您当前(未提交)的分支

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

相关问题 如何在不检查的情况下浏览不同的git分支 - How do I browse a different git branch without checking it out 如何在不签出分支的情况下创建分支? - How to create a branch without checking the branch out? 如何判断git子模块应该在哪个提交,标记和分支上运行而无需检出 - How do you tell which commit, tag, and branch a git submodule should be on without checking it out 如何创建没有提交历史的分支,该分支链接回分支的来源? - How do I create a branch without commit history, that links back to where it branched from? GIT:在签出另一个分支之前,我是否需要提交我的分支,什么是存储? - GIT: Do I need to commit my branch before checking out another branch, what about stashing? 如何从本地和远程的每个分支的Git Commit历史记录中删除文件? - How do I delete a file from the Git Commit history from every branch locally and remotely? 如何在不添加分支的完整提交历史记录的情况下合并另一个仓库中的分支? - How can I merge a branch from another repo without adding the branch's full commit history? 显示其他分支的提交历史 - Display the commit history of a different branch 如何在不“检查”的情况下获取远程分支 - How do you fetch a remote branch without "checking it out" 将文件提交到不同的分支而无需签出 - Commit a file to a Different Branch Without Checkout
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM