This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function __show_git_repo_branch { | |
AFTER_HOOK="$1" | |
local CURRENT_BRANCH=$(git branch 2>/dev/null| grep -e '^*' | cut -b 3-) | |
if [ -n "${CURRENT_BRANCH}" ]; then | |
local IS_MODIFIED=$(git status --short | wc -l) | |
PS1+="${__GIT_COLOR}${__GIT_START_CHAR}${__GIT_BRANCH_COLOR}${CURRENT_BRANCH}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
COUNTER_FILE="${HOME}/bin/.counter_date" | |
get_counter() { | |
# Read counter file | |
if [ -f "${COUNTER_FILE}" ]; then | |
# Check if file is same day that today | |
COUNTER_FILE_DATE=$(date -r "${COUNTER_FILE}" +"%Y%m%d") | |
CURRENT_FILE_DATE=$(date +"%Y%m%d") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Check only if git commit | |
if [ "$1" = "push" ]; then | |
__OK_COLOR="\e[42m" | |
__CANCEL_COLOR="\e[41m" | |
__NORMAL_COLOR="\e[m" | |
__BRANCH_COLOR="\e[33m" | |
__BRANCH=$(git rev-parse --abbrev-ref HEAD) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[alias] | |
co = checkout | |
br = branch | |
ci = commit | |
st = status | |
ss = status -s | |
l = log --graph --pretty=format:\"%C(yellow)%h%Creset%C(red)%d%Creset %C(cyan)%cr%Creset %s %Creset%C(green)%an\" | |
lf = log --pretty=fuller | |
unadd = reset HEAD^ | |
graph = log --graph --abbrev-commit --decorate --format=format:'%C(yellow)%h%C(reset)%C(auto)%d%C(reset) %C(normal)%s%C(reset) %C(dim magenta)%an%C(reset) %C(dim blue)(%ar) %C(reset)' --all |