Skip to content

Instantly share code, notes, and snippets.

View ethaizone's full-sized avatar
💭
It's same on Gitlab.

Nimit Suwannagate ethaizone

💭
It's same on Gitlab.
View GitHub Profile
@ethaizone
ethaizone / terminal-prompt-git-branch-status-zsh.md
Last active February 20, 2025 05:46 — forked from reinvanoyen/terminal-prompt-git-branch-zsh.md
Add Git Branch Name and Status to Terminal Prompt (MacOS zsh)

Add Git Branch Name and Status to Terminal Prompt (zsh)

image

Install

Open ~/.zshrc in your favorite editor and add the following content to the bottom.

git_status() {
    # Early return if not in a git repository