Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

color dependent on branch #311

Closed
cboltz opened this issue Mar 19, 2017 · 1 comment
Closed

color dependent on branch #311

cboltz opened this issue Mar 19, 2017 · 1 comment

Comments

@cboltz
Copy link

cboltz commented Mar 19, 2017

Is it somehow possible to set the branch color depending on the branch name?

I'd like to have something like:

  • master: black
  • everything else: red

to clearly indicate when I'm not working on master.

It would be even better to have a lookup map or function to make this flexible - one of the repos I'm working with uses "production" instead of "master" ;-) and maybe some people also want a different color for specific branches.

Is there a way to do this already (if so, what did I overlook?), or would you be willing to implement it?

(CC @ccboltz)

@magicmonty
Copy link
Owner

Currently there is no such functionality in the prompt, but its a nice idea. If you want to make a PR I think I will happily accept it ;)

cboltz pushed a commit to cboltz/bash-git-prompt that referenced this issue Dec 17, 2017
- add $GIT_PROMPT_MASTER_BRANCH - color for master branch
- add $GIT_PROMPT_MASTER_BRANCHES - branch name(s) that use
  $GIT_PROMPT_MASTER_BRANCH color, 'master' by default)

All other branches will continue to use $GIT_PROMPT_BRANCH

Fixes magicmonty#311
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants