Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ranjitiyer/4fdfaa1ec3a6a4c6cc969218be902da9 to your computer and use it in GitHub Desktop.
Save ranjitiyer/4fdfaa1ec3a6a4c6cc969218be902da9 to your computer and use it in GitHub Desktop.
bash prompt
export PS1="\@ \w $(if [[ -e .gitignore ]]; then git branch | head -n 1 | awk '{print $2}'; fi) > "
Prints time in am/pm, the current working directory and the checked out gitbranch if pwd is a git repo
01:39 PM ~/work/emr/sparkmagic jupyter >
@ranjitiyer
Copy link
Author

export PS1="@ \w[\033[33m]$(parse_git_branch)[\033[00m] $"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment