Skip to content

Instantly share code, notes, and snippets.

View lukestringer90's full-sized avatar

Luke Stringer lukestringer90

View GitHub Profile
@lukestringer90
lukestringer90 / terminal-prompt-git-branch-zsh.md
Last active January 23, 2024 18:18 — forked from reinvanoyen/terminal-prompt-git-branch-zsh.md
Add Git Branch Name to Terminal Prompt (MacOS Catalina zsh)
# --- GIT BRANCH PROMPT ---

function git_branch_name()
{
  branch=$(git symbolic-ref HEAD 2> /dev/null | awk 'BEGIN{FS="/"} {print $NF}')
  if [[ $branch == "" ]];
  then
    :
 else