@@ -23,6 +23,30 @@ of these commits returned makes sense to be from most recent to oldest.
2323Now that we can control how many commits we see by number, we can focus on some actual
2424content within the commits.
2525
26+ ##Filtering results
27+
28+ * ` git log --grep="add" `
29+ ` --grep ` is used just like you'd use it from the command line, you have to say
30+ specifically what you'd want to search for. When we use a term to grep for, we're only
31+ going to search the log for that term in the commit message itself. This is one example
32+ of why a descriptive commit message could be super useful (besides just allowing friends
33+ or coworkers to see what you're up to without reading your code.
34+
35+ * ` git log --diff-filter=R ` needs ` -M ` or ` -C ` etc
36+ * find commits with only particular things, like renames
37+ * Matthew once committed a bunch of renames without fixing links, to find out what the files
38+ were and renamed to, I used this in corrdination with ` --author="matthew" `
39+
40+ * `git log --since="2 weeks ago"
41+ * grab all the commits that happened between now and 2 weeks ago
42+ * `git log --before="2 weeks ago"
43+ * grab commits that happened from 2 weeks ago and OLDER
44+ * ` git log 6cb8fdd...9c014a9 ` ie: all logs AFTER ` 6cb8fdd ` until ` 9c014a9 `
45+ * Similar to github.com/user/repo/compare/master@{2.weeks.ago}...master
46+
47+ * ` git log --author="brent" `
48+ * find commits only authored by a given person
49+
2650##Viewing Content
2751
2852* ` git log --stat `
@@ -79,29 +103,6 @@ place.
79103Now that we can see specific changes in a commit, how do we find a specific commit? One
80104way to do so would be with the ` --grep ` flag.
81105
82- ##Filtering results
83-
84- * ` git log --grep="add" `
85- ` --grep ` is used just like you'd use it from the command line, you have to say
86- specifically what you'd want to search for. When we use a term to grep for, we're only
87- going to search the log for that term in the commit message itself. This is one example
88- of why a descriptive commit message could be super useful (besides just allowing friends
89- or coworkers to see what you're up to without reading your code.
90-
91- * ` git log --diff-filter=R ` needs ` -M ` or ` -C ` etc
92- * find commits with only particular things, like renames
93- * Matthew once committed a bunch of renames without fixing links, to find out what the files
94- were and renamed to, I used this in corrdination with ` --author="matthew" `
95-
96- * `git log --since="2 weeks ago"
97- * grab all the commits that happened between now and 2 weeks ago
98- * `git log --before="2 weeks ago"
99- * grab commits that happened from 2 weeks ago and OLDER
100- * ` git log 6cb8fdd...9c014a9 ` ie: all logs AFTER ` 6cb8fdd ` until ` 9c014a9 `
101- * Similar to github.com/user/repo/compare/master@{2.weeks.ago}...master
102-
103- * ` git log --author="brent" `
104- * find commits only authored by a given person
105106
106107
107108* Chaining previous flags together
0 commit comments