So, I have a repository and suspicions that someone accidentally commited credentials into it
I need to find all commits which contains my credentials: tiWEythzNEX8N3sktiWEythzNEX8N3sk
Let's see some commits. There is small repo to reproduce
Use command git log --oneline -n 10
963f080 (HEAD -> find-credentials-git-log) feat(3309): add middleware
b83a41f fix(3309): rm credentials
70ec8dc bug: ooops I show my credentials
895937f feat(3309): add server
534792d feat(3309): add types
9cce5c9 feat(3309): add position entity
Now lets see git diff of 70ec8dc bug: ooops I show my credentials
commit
Use command git show 70ec8dc
commit 70ec8dc914609d50bd0ef3c0b420db0b7a4aa7f5
Author: Yegor <mail@gmail.com>
Date: Wed Jun 19 12:21:38 2019 +0300
bug: ooops I show my credentials
diff --git a/typeorm/3309/startServer.ts b/typeorm/3309/startServer.ts
index 0f1c9bd..b3bd09e 100644
--- a/typeorm/3309/startServer.ts
+++ b/typeorm/3309/startServer.ts
@@ -45,7 +45,7 @@ export const startServer = async () => {
prefix: redisSessionPrefix
}),
name: 'offerhub',
- secret: process.env.SESSION_SECRET,
+ secret: 'tiWEythzNEX8N3sktiWEythzNEX8N3sk', // My credentials
resave: false,
saveUninitialized: false,
cookie: {
I need to find all commits which git diff
contains this text/credentials tiWEythzNEX8N3sktiWEythzNEX8N3sk
. How to do it?
git log --oneline -S 'tiWEythzNEX8N3sktiWEythzNEX8N3sk'
See the doc here.