Search code examples
gitbashatlassian-sourcetreesourcetree

How to display datetime in SourceTree terminal bash


This is referring to the git Terminal that can be launched from the Atlassian SourceTree desktop client on Windows (7). I just want to be able to see the datetime for when a command was run. Right now all I see when I run a git command in this Terminal is:

username@machine MINGW64 /path/to/git/dir (branch)

I want to see something like:

2016-06-22T21:01:48+00:00 username@machine MINGW64 /path/to/git/dir (branch)

Where can I edit the .bashrc file to show this? I can't find an option in the SourceTree desktop client.


Solution

  • If you know the path of git used by SourceTree (embedded or external git), you can modify <git>\etc\profile.d\git-prompt.sh with:

    PS1="$PS1"'\w \t'             # current working directory
    

    The \t will add the timestamp to the git bash prompt:

    vonc@voncavn7 MINGW64 /d/git/tests/subm/p1 23:45:37 (master)
    

    git bash timestamp