My normal terminal command line has suddenly disappeared and has been replaced by this git command line ➜ ~ git:(master) ✗
.
How do I get rid of this an
I know your problem , You are using zsh
, right?
If so, you should add export PS1=xxxxx
to ~/.zshrc
, not ~/.bashrc
.
Or you just don't use zsh
, input bash
and switch to bash.input
chsh -s /bin/bash
to change the default shell to bash
.
I also has this problem like: "➜ ~ git:(master) ✗" on the Mac OS X. Because I type the command "git init".
When I type the command "rm -R .git", it comes back into normal command line in Terminal. PS: I use zsh.
Open your ZSH config file
sudo vim ~/.zshrc
and paste below command at the bottom of the file
PROMPT='${ret_status} %{$fg[cyan]%}%c%{$reset_color%} '
this will show current directory
You must have installed something (I'm not sure what) that modified your prompt to give you context-sensitive information about the Git repository (if any) you're in.
Simply adding
export PS1="\h:\W \u\$ "
at the very bottom of your
~/.bash_profile
file, if you use bash
, or~/.zshrc
file, if you use zsh
,and then sourcing that file (or restarting Terminal) should rid you of that fancy colourful prompt.
There is nothing wrong with your system or you change something involuntarily. You must have download oh-my-zsh and set your default terminal from bash to zsh. Oh-my-zsh has many different themes, all these themes have different appearances and provide more efficient functions, git information is one of them. The default theme of oh-my-zsh is "robbyrussell" and it just looks like your shell prompt. You can go to "~/.oh-my-zsh/themes" to choose your favorite theme and apply it to the configuration file "./zshrc". I know you have solved the problem by uninstalled the zsh and use the original bash, I just want to tell you the essential reason of this problem. And oh-my-zsh truly provides some convenience which helps you use the command line, maybe you should try it again!
if you having seen the (master) in somewhere your folder. try this
git rm .git
It will automatically remove the master