Skip to content

Commit f9bdaa7

Browse files
author
Bruno Passos
committed
Useful command to check number of lines added and removed by an author
1 parent bdac92e commit f9bdaa7

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,9 @@ $ git checkout -- filename
380380

381381
# Shows more detailed info about a commit
382382
$ git cat-file sha -p
383+
384+
# Show number of lines added and removed from a repository by an author since some time in the past.
385+
$ git log --author="Author name" --pretty=tformat: --numstat --since=month | awk '{ add += $1; subs += $2; loc += $1 - $2 } END { printf "added lines: %s, removed lines: %s, total lines: %s\n", add, subs, loc }'
383386
```
384387

385388
#### Useful alias

translation/README.pt-br.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,10 @@ $ git checkout -- nomedoarquivo
391391

392392
# Mostra informações mais detalhadas sobre um commit
393393
$ git cat-file sha -p
394+
395+
# Mostra o número de linhas adicionadas e removidas em um repositório por um autor desde uma data no passado até o presente
396+
397+
$ git log --author="Nome do autor" --pretty=tformat: --numstat --since=mes | awk '{ add += $1; subs += $2; loc += $1 - $2 } END { printf "added lines: %s, removed lines: %s, total lines: %s\n", add, subs, loc }'
394398
```
395399

396400
#### Alias úteis

0 commit comments

Comments
 (0)