Skip to content

Instantly share code, notes, and snippets.

@JackyYin
Created July 22, 2019 00:58
Show Gist options
  • Save JackyYin/1c39b3982e3cba141568d77f2a985e77 to your computer and use it in GitHub Desktop.
Save JackyYin/1c39b3982e3cba141568d77f2a985e77 to your computer and use it in GitHub Desktop.
parse my git branch
#!/bin/sh
parse_git_branch() {
git branch -a | sed -e "/^[^*]/d" -e "s/* \(.*\)/ $(echo '\033[1;31m')\1/"
}
echo $(parse_git_branch)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment