Skip to content

Instantly share code, notes, and snippets.

@RyanMagnusson
Forked from pwenzel/git-log-to-tsv.sh
Last active November 18, 2015 17:59
Show Gist options
  • Select an option

  • Save RyanMagnusson/209bd58ff691314f43d2 to your computer and use it in GitHub Desktop.

Select an option

Save RyanMagnusson/209bd58ff691314f43d2 to your computer and use it in GitHub Desktop.

Revisions

  1. RyanMagnusson revised this gist Nov 18, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion pretty-printing-git-log.md
    Original file line number Diff line number Diff line change
    @@ -13,7 +13,7 @@
    1. For each repository run:

    ```bash
    git log --date=local --pretty=format:"%h%x09%an%x09%ad%x09%s" > ~/commits.local-<REPO_NAME>.tsv.txt
    git log --date=local --pretty=format:"%h%x09%an%x09%ad%x09%s%x09${REPO_NAME}" > ~/commits.local-<REPO_NAME>.tsv.txt
    ```
    1. Merge the results together into a single file
    ```bash
  2. RyanMagnusson revised this gist Nov 18, 2015. 2 changed files with 1 addition and 10 deletions.
    10 changes: 1 addition & 9 deletions git-log-to-tsv.sh
    Original file line number Diff line number Diff line change
    @@ -2,12 +2,4 @@
    git log --date=local --pretty=format:"%h%x09%an%x09%ad%x09%s" > commits.local.tsv.txt

    # ISO Dates:
    git log --date=iso --pretty=format:"%h%x09%an%x09%ad%x09%s" > commits.iso.tsv.txt

    ## For multiple Repos:
    for r in [list]; do
    # for each repo
    git log --date=local --pretty=format:"%h%x09%an%x09%ad%x09%s" > ~/commits.local-<REPO_NAME>.tsv.txt


    done
    git log --date=iso --pretty=format:"%h%x09%an%x09%ad%x09%s" > commits.iso.tsv.txt
    1 change: 0 additions & 1 deletion new_gist_file_2
    Original file line number Diff line number Diff line change
    @@ -1 +0,0 @@
    _
  3. RyanMagnusson revised this gist Nov 18, 2015. 3 changed files with 36 additions and 1 deletion.
    10 changes: 9 additions & 1 deletion git-log-to-tsv.sh
    Original file line number Diff line number Diff line change
    @@ -2,4 +2,12 @@
    git log --date=local --pretty=format:"%h%x09%an%x09%ad%x09%s" > commits.local.tsv.txt

    # ISO Dates:
    git log --date=iso --pretty=format:"%h%x09%an%x09%ad%x09%s" > commits.iso.tsv.txt
    git log --date=iso --pretty=format:"%h%x09%an%x09%ad%x09%s" > commits.iso.tsv.txt

    ## For multiple Repos:
    for r in [list]; do
    # for each repo
    git log --date=local --pretty=format:"%h%x09%an%x09%ad%x09%s" > ~/commits.local-<REPO_NAME>.tsv.txt


    done
    1 change: 1 addition & 0 deletions new_gist_file_2
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    _
    26 changes: 26 additions & 0 deletions pretty-printing-git-log.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,26 @@
    #Pretty Format of Git Log

    ## Local Dates:
    ```bash
    git log --date=local --pretty=format:"%h%x09%an%x09%ad%x09%s" > commits.local.tsv.txt
    ```

    ## ISO Dates:
    ```bash
    git log --date=iso --pretty=format:"%h%x09%an%x09%ad%x09%s" > commits.iso.tsv.txt
    ```
    ## For multiple Repos:
    1. For each repository run:

    ```bash
    git log --date=local --pretty=format:"%h%x09%an%x09%ad%x09%s" > ~/commits.local-<REPO_NAME>.tsv.txt
    ```
    1. Merge the results together into a single file
    ```bash
    cat ~/commits.local-* > ~/all-repos-commits.tsv.txt
    ```

    ## CSV Format for Excel
    ```bash
    git log --date=iso --pretty=format:'"%h","%an","%ad","%s"'
    ```
  4. @pwenzel pwenzel created this gist Jun 6, 2012.
    5 changes: 5 additions & 0 deletions git-log-to-tsv.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    # Local Dates:
    git log --date=local --pretty=format:"%h%x09%an%x09%ad%x09%s" > commits.local.tsv.txt

    # ISO Dates:
    git log --date=iso --pretty=format:"%h%x09%an%x09%ad%x09%s" > commits.iso.tsv.txt