DEV Community

Shiono Yoshihide
Shiono Yoshihide

Posted on

A Guide for Upgrading macOS to Catalina and Migrating the Default Shell from Bash to Zsh


  • From Bash to Zsh
  • Configure Zsh
    • Minimal Configuration
    • Enable Git Completion
    • Define Aliases
  • Prettify the Console with Starship 🚀

From Bash to Zsh

After upgrading macOS to Catalina (lol), the command below changes the default shell to zsh:

$ chsh -s /bin/zsh

That's it!

Configure Zsh

Minimal Configuration

To configure zsh, just populate ~/.zshrc like this:

# enable the default zsh completions!
autoload -Uz compinit && compinit

Enable Git Completion

To enable git completion, try commands below:

# make the `.zsh` directory
$ mkdir -p ~/.zsh
$ cd ~/.zsh

# download the scripts for completion
$ curl -o git-completion.bash
$ curl -o _git

After that, we can load the scripts in the ~/.zshrc:

zstyle ':completion:*:*:git:*' script ~/.zsh/git-completion.bash
fpath=(~/.zsh $fpath)

Finally, remove the cache:

$ rm ~/.zcompdump

Define Aliases

My favorite and minimal aliases are:

alias ..='cd ..'
alias ...='cd ../..'
alias ls='ls -GwF'
alias ll='ls -alh'

Yes ll is not defined when using zsh.

And if we use VSCode, we can edit ~/.zshrc by running the command zshrc:

alias zshrc='code ~/.zshrc'

In the same way, to edit ~/.gitconfig by the command gitconfig, add the line below in the ~/.zshrc:

alias gitconfig='code ~/.gitconfig'

Prettify the Console with Starship 🚀

Do you know starship?

TLDR, see my pretty console :)

my pretty console image

I love this console! lol


$ brew install starship

And add the init script to the end of ~/.zshrc:

eval "$(starship init zsh)"


For full information, please see the documentation.

My minimal configuration as a TypeScript developer, a cat lover and a basketball enthusiast is:

# in `~/.config/starship.toml`

symbol = "🐈💕"

fish_style_pwd_dir_length = 10

symbol = "🏀 "

symbol = "⚡ "

symbol = "🎉 "
symbol why or what
🐈💕 just so cute - nyaaan in Japanese / meow in English
🏀 master git branch
⚡ v12.11.1 nodejs version
🎉 v6.6.0 package version


No console, no developers :)

Top comments (9)

davidxswang profile image

Thank you for this post! I met the problem a few days ago that I cannot use auto completion when I was using git, but it worked before. I searched a lot of places but didn't solve this problem perfectly, either prompting warning for me or prompting a lot of errors. Your post just solved it! Thank you!

stephanie profile image
Stephanie Handsteiner

zsh + ohmyzsh + powerlevel10k >

codercatdev profile image
Alex Patterson

I too am a cat lover, basketball enthusiast, and struggling TypeScript developer 🙀.

Great tutorial!

pedroapfilho profile image
Pedro Filho

What should I do if I already had zsh+ohmyzsh installed?

saltyshiomix profile image
Shiono Yoshihide

You can see the current default shell by running the command below:

$ echo ${SHELL}

If the result is /bin/zsh, this is the default macOS shell.

So you need to change it:

$ chsh -s /path/to/your/custom/zsh

And check your default shell has changed by running echo ${SHELL} :)

codenutt profile image

How lucky for us who switched to Zsh many moons ago lol

walkingriver profile image
Michael D. Callaghan

Very nice. Thank you.

brando90 profile image

does one not need (the old) .bashrc anymore when using zsh? Everything goes to .zhrc right?

saltyshiomix profile image
Shiono Yoshihide

If you are using MacOS Catalina from the first, everything goes to zsh. Otherwise if you upgrade OS, we need change the default shell from bash to zsh :)