diff --git a/cmd/gosec/main.go b/cmd/gosec/main.go
index <HASH>..<HASH> 100644
--- a/cmd/gosec/main.go
+++ b/cmd/gosec/main.go
@@ -249,6 +249,10 @@ func main() {
 	if err != nil {
 		fmt.Fprintf(os.Stderr, "\nError: failed to exclude the %q directory from scan", "vendor")
 	}
+	err = flag.Set("exclude-dir", ".git")
+	if err != nil {
+		fmt.Fprintf(os.Stderr, "\nError: failed to exclude the %q directory from scan", ".git")
+	}
 
 	// Parse command line arguments
 	flag.Parse()
Exclude .git directory from scan (#<I>)