简体   繁体   中英

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM