I put this configuration on every machine I work on in ~/.gitconfig
.
It set the global scope ; equivalent to git config --global <key> <value>
.
[user]
name = jeandat
email = jean.dat@gmail.com
By combining the power of git and bash, we can have in an instant an estimation of lines number in a project.
For instance to count lines number in versionned perl files:
$ git ls-files | egrep ".*(driver|core).*pl$" | xargs wc -l
git ls-files
will only return files versionned which is a first interesting filter.-- For those blessed with MySQL >= 5.1.12: | |
-- If you prefer to output to a table: | |
SET GLOBAL log_output = 'TABLE'; | |
SET GLOBAL general_log = 'ON'; | |
-- Take a look at the table mysql.general_log | |
-- If you prefer to output to a file: |
# Add current git branch in prompt | |
function parse_git_branch () { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/' | |
} | |
RED="\[\033[0;31m\]" | |
YELLOW="\[\033[0;33m\]" | |
GREEN="\[\033[0;32m\]" | |
NO_COLOUR="\[\033[0m\]" | |
PS1="$GREEN\u@$(hostname)$NO_COLOUR:\w$YELLOW\$(parse_git_branch)$NO_COLOUR\$ " |