0

ファイルを変更したすべてのコミットの数を取得するにはどうすればよいですか? これには移動/名前変更を含める必要はありませんが、含まれていれば問題ありません。

4

2 に答える 2

4

git log --oneline -- path/to/file | wc -l

于 2013-01-21T07:38:35.963 に答える
0

ログ ファイルまたは HEAD ファイルで、commit が表示されるたびに「commit:」が追加されます。

そのような; ここに 3 つのコミットがあります。

60b09150ac190a26de5ae185046bf518ad35e6f8 eaee963404432be926c6e9bc77d40be3d9e9ed65 burak <burak@192.168.5.222> 1353615257 -0500  commit: I added batch loader method for the emages This method helps me load a bunch of images and ensure they are       * fully loaded when we want to use them.       imageFile The path and name of the image file to load.      *   tracker This will help ensure all the images are loaded.      *    id A unique identifier for each image in the tracker. It      * will only wait for ids it knows about.      *   A constructed image that has been registered with the tracker.      * Note that the image's data has not necessarily been fully loaded when       * this method ends.
    eaee963404432be926c6e9bc77d40be3d9e9ed65 0499e1e64cc904591020e2c79dcd64827b1015ba burak <burak@burak-THINK> 1353808160 -0500    commit: AnimatedSpriteViewer added open sprite feature by chosing a file from file choser, after user picks up the file, user should be able to load the entire state and name of the pose. Tested and fully functionally works
    0499e1e64cc904591020e2c79dcd64827b1015ba 181bc7ab293a8710cb14664433043a4ebbe4b377 burak <burak@129.49.192.56> 1354006011 -0500  commit: Ideally, the hash function should map each possible key to a unique slot index, but this ideal is rarely achievable in practice (unless the hash keys are fixed; i.e. new entries are never added to the table after it is created). Instead, most hash table designs assume that hash collisions—different keys that map to the same hash value—will occur and must be accommodated in some way.

そのため、HEAD ファイルまたはログ ファイルで、number of commit: word; を出力して検索できます。

cat git.log | grep commit: > number_of_line.txt

次に、ファイル内の commit: の数を数えます

wc -ls number_of_lines.txt
于 2013-01-21T07:46:08.493 に答える