簡體   English   中英

找到文件類型的所有git提交

[英]find all git commits for a file type

找到包含特定文件的所有提交非常簡單。

git log -- .\Database\Tables\sometable.sql

但有沒有一種簡單的方法來查找文件類型的所有提交(遞歸向下子目錄?)或者我是否需要編寫腳本來執行此操作?

(概念...)

git log -- .\Database\*.sql --recursive

看來你可能只需要轉義*這樣它就不會被命令行擴展。 看起來你在Windows上......所以我在Linux上測試過這樣:

git init
mkdir -p blue/red/green
touch blue/red/green/colors
git add blue/red/green/colors
git commit -m "colors and dirs"
touch blackAndWhite
git add blackAndWhite
git commit -m 'b&w'
git log -- \*ors

最后一個git log的結果是:

commit 8fdb718b5b616dd495c00eb7a6d123c33f7707e5
Author: <snipped>
Date:   Sun Oct 14 19:49:43 2012 -0400

    colors and dirs

在Windows上逃避* ...也許把它放在單引號或雙引號中? 如果我想出辦法,我會補充一下。

我希望按類型查看我的存儲庫中所有用戶的所有貢獻。 我找到了一個可以做到這一點的Ruby包, git fame這里 )。 如果你輸入git fame . --by-type git fame . --by-type它將輸出如下內容:

在此輸入圖像描述

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM