Merge branch 'nzachow-master'

This commit is contained in:
Richard Littauer 2018-11-29 14:17:40 -05:00
commit b67b184d8a
1 changed files with 12 additions and 0 deletions

View File

@ -94,6 +94,7 @@ All commands should work for at least git version 2.13.0. See the [git website](
- [I want to find a string in any commit](#i-want-to-find-a-string-in-any-commit)
- [I want to find by author/committer](#i-want-to-find-by-authorcommitter)
- [I want to list commits containing specific files](#i-want-to-list-commits-containing-specific-files)
- [I want to view the commit history for a specific function](#i-want-to-view-the-commit-history-for-a-specific-function)
- [Find a tag where a commit is referenced](#find-a-tag-where-a-commit-is-referenced)
- [Submodules](#submodules)
- [Clone all submodules](#clone-all-submodules)
@ -1355,6 +1356,17 @@ While using wildcards, it's useful to inform `--name-status` to see the list of
$ git log --name-status -- **/*.js
```
<a name="#i-want-to-view-the-commit-history-for-a-specific-function"></a>
### I want to view the commit history for a specific function
To trace the evolution of a single function you can use:
```sh
$ git log -L :FunctionName:FilePath
```
Note that you can combine this with further `git log` options, like [revision ranges](https://git-scm.com/docs/gitrevisions) and [commit limits](https://git-scm.com/docs/git-log/#_commit_limiting).
### Find a tag where a commit is referenced
To find all tags containing a specific commit: