How to view file history in Git?

Source: Internet
Author: User

Reference: Http://stackoverflow.com/questions/1786027/how-to-view-file-history-in-git

Use git log to view the commit history. Each commit have an associated revision specifier a hash key (e.g. 14b8d0982044b0c49f7a855e396206ee65c0e787 and b41 0ad4619d296f9d37f0db3d0ff5b9066838b39). To view the difference between and different commits, use Git diff with the first Few characters of the revision specifiers of both commits, like so:

# diff between commits 14b8 ... and b410 ...
Git diff 14b8. b410
# only include Diff of specified files
Git diff 14b8. b410 path/to/file/a path/to/file/b
If you want to get a overview over all the differences this happened from commit to commit, use git log or git whatchange D with the patch option:

# include patch displays in the commit history
Git log-p
Git whatchanged-p
# only get the history of those commits that touch specified paths
git log path/a path/b
git whatchanged path/c path/d

GITK Path/to/file
git diff path/to/file
git log path/to/file
git log

How to view file history in Git?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.