Skip to content

Instantly share code, notes, and snippets.

View TimDorand's full-sized avatar

Timothée Dorand TimDorand

View GitHub Profile
@TimDorand
TimDorand / rebaseandpush.sh
Created June 3, 2020 09:27
Ultimate Rebase And Push Executable. Takes the current branch in first param.
#!/bin/bash
echo "$(tput setaf 3)Rebasing branch $1 with develop and pushing $(tput sgr0)
"
git stash && git checkout develop && git pull --rebase && git checkout $1 && git rebase origin/develop && git push -f origin $1
@TimDorand
TimDorand / bash_profile.sh
Last active February 3, 2021 09:57
Ultimate Terminal Prompt (Date / Folder / Git branch)
# FOR CATALINA AND HIGHER
function parse_git_branch() {
git branch 2> /dev/null | sed -n -e 's/^\* \(.*\)/[\1]/p'
}
setopt PROMPT_SUBST
export PROMPT='%F{grey}%n%f %F{cyan}%~%f %F{green}$(parse_git_branch)%f %F{normal}$%f '
# FOR THE REST
@TimDorand
TimDorand / .zshrc
Created February 3, 2021 09:57
Simple zshrc with pwd and git branch on the right
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
#[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
# Load version control information
autoload -Uz vcs_info
precmd() { vcs_info }
# Format the vcs_info_msg_0_ variable
zstyle ':vcs_info:git:*' formats '%b'