Closed mixolidia closed 8 years ago
@mixolidia 👋 I love that you included a tag on this!!!
Here is the info you should need -
To print the name of your currently checked out branch in your prompt, include this line as part of your PS1
:
git branch 2>/dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
A few people also asked about @patrickmckenna's Terminal.app theme. He uses ocean-terminal. His PS1
(prompt) is
export PS1="\[\$(tput bold)\]\[\$(tput setaf 6)\]\w\[\$(tput setaf 3)\]\$(git branch 2>/dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/')\[\$(tput setaf 6)\] > \[\$(tput sgr0)\]"
I'm going to close this issue, hopefully all is working well. Please feel free to comment here again if you are having issues. Or, let us know in gitter: https://gitter.im/githubteacher/fluffy-octo-guacamole 😄
Hi @brianamarie Thanks! I'll try it during the next break & let you know how it works out.
Thanks for the <3 on my tag 😀 . What's a PS1?
@mixolidia PS1 is a *nix command prompt. If you are using windows, and you use Git Bash, you'll automatically get the branch names. Does that make sense?
@mixolidia This may be a bit more thorough of an explanation: https://gist.github.com/githubteacher/e75edf29d76571f8cc6c
Hi,
I'm hoping to add some of the terminal tweaks I see @githubteacher has on their terminal.
My command line shows me the name of my computer and directory I'm in like this:
How do I have my terminal show the current branch I'm in along with the information it is already showing, my computer name and directory?
Also, when I press the tab key on my terminal it completes the file or folder name but not the git branch I want to check out to, how do I get it to complete the branch name when I press the Tab key?
Thanks :octocat:s