Git Bash For Mac Catalina

Git is a version control system that allows developers to track a project and actively contribute without interfering in each other’s work. Learn how to install Git, with four different installation approaches and get started with using the system. Configure Git and see how to track and commit changes. Apple has announced that in macOS 10.15 Catalina the default shell will be zsh. In this series, I will document my experiences moving bash settings, configurations, and scripts over to zsh. Some of the most popular extensions are Git Lens, Angular Essentials, Sublime Text Keymap, and Debugger for Chrome. Oh, and did I tell you that it’s completely free? Download: Visual Studio Code 10. MacVim Text Editor. MacVim is the Mac clone of long standing, widely used, and extremely powerful Unix text-editor Vim. The best part about using. Simple bash script to create a Bootable ISO from macOS Catalina Install Image from Mac App Store - create-iso.sh. Clone via HTTPS Clone with Git or checkout with.

  • Bash used to be the default shell in macOS
  • Zsh has been many developers’ favourite alternative
  • I’ve been happy enough with Bash, but ready to level up 🚀

It’s been 928 days since my notes to figure out wtf is bash anyway?! — and it’s time to move on.

The default shell on macOS Catalina has changed from Bash to Zsh. You have to run a command to actually make the change and many think that Zsh is better. If you’ve made the switch and want to change back to Bash as the default shell whenever you open Terminal, it’s an easy change to make. Here’s how you can switch back to bash in Terminal. @MarkSetchell Git is a programming tool, so I think this is actually on-topic here (although not necessarily a good question). – Joseph Sible-Reinstate Monica Dec 21 '19 at 6:06 add a comment. My previous post How I setup my Mac for development will work just fine with older macOS. But now that it's Catalina, bash has been changed to zsh and I want to note my setup and other findings here. Most of the steps are the same except nvmrc part. Check / Set my home folder I sometime see people use long username in home folder.

The internet is helpful 🔗

  • Apple: Use zsh as the default shell on your Mac
  • Chen Hui Jing: Switching from bash to zsh
  • Mike Buss: A Beautifully Productive Terminal Experience

Silence the warning 🤫

With macOS Catalina the default shell was changed to Zsh. When I was setting up an new work laptop last November, I was in no way ready to deal with changing all things shell at the same time. But an account set up to use Bash would start getting a persistent and noisy deprecation warning:

At the time, I put this in my .bash_profile to make the warning go away:

But today is the day we level up and change the shell. Soooo, how tf to do that?! 🤷🏻‍♀️

Configure account to now use zsh

Before I removed the silencing and got back the helpful deprecation warning… I was reading about how to change it in the GUI under System Preferences. There’s a hidden “advanced options” you can find with a control-click on user name. The article from Apple also attempts to describe how to do it from the command line, so I was doing a cat /etc/shells to understand what they meant with “one of the shell paths listed”. But anyway, the deprecation warning explained exactly what to run:

chsh -s /bin/zsh

But how to migrate existing bash stuff?! 🤔

.zprofile is equivalent to .bash_profile and runs at login, including over SSH
.zshrc is equivalent to .bashrc and runs for each new Terminal session

Ok!? Not sure this was the way to go, but I renamed these files like so:

New shell is now spewing out these warnings:

Ha. I know what those 3 things are. And happy with past-me for writing comments:

Hm. I’ll remove them and figure out how to set up something similar in zsh. All right, then the noise is gone. Let’s see what works and what doesn’t?!

Aliases still work…

That’s unexpected. Ah, I have this in my now named .zshrc and that apparently finds them:

For now, I am deleting my .bash_aliases file completely, and copying the aliases I want to keep over to .zshrc. Also deleting .bash_history while I’m at it, though I have kept a copy as a txt file in case something useful resides in there.

A POSIX-compliant profile ?!

If you're using .profile, you can make zsh automatically read its settings by adding this command to .zprofile:

Ok. Yes. I’ve got that file. But the only thing it contains is:

Not sure what to do about this. Checking the docs on Rust installation I see there’s mention about Configuring the PATH environment variable. Perhaps I can run some rustup install scripts to confgure the path correctly. Or I can just see if something breaks next week when developing.

Zsh todo

Making a list of what I’ve lost and/or intentionally removed:

  • promt
  • git completion
  • something with nvm bash_completion
  • how history works (there’s a new .zsh_history but it’s empty

There are also tokens and paths I want to check still works. I was a bit curious about setting up minimal configuration before going bananas with frameworks and plugins. Read about manually Adding Git Completion to Zsh but decided to proceed with choosing between:

Oh My Zsh or Prezto?

Oh-my-zsh has a much larger selection of themes and plugins, but Prezto’s tab completion is noticeably faster. If you have a plugin you’d really miss by switching to Prezto, I’d suggest sticking with oh-my-zsh. Otherwise, the speed increase is well worth the switch.

– A Beautifully Productive Terminal Experience

While Prezto is obviously widely used and maintained, I’m going to go with the community and what I’d heard about before, and install Oh My Zsh.

Right, I now have files attempting to zsh config, so perhaps diving straight for the framework would have made more sense then renaming like I did. But anyway!

🥳

And now for plugins and themes bonanza…

I have to set up a MacBook Pro fairly often - when starting a new job and when buying a new personal computer. I created this article back in 2015 when I got my first Mac and have been updating it ever since with whatever I need as my job evolves. I'm primarily a full-stack web developer, so most of my needs will revolve around JavaScript/Node.js.

Getting Started

The setup assistant will launch once you turn the computer on. Enter your language, time zone, Apple ID, and so on. The first thing you should do is update macOS to get the latest security updates and patches.

Homebrew

Install the Homebrew package manager. This will allow you to install almost any app from the command line.

Make sure everything is up to date.

Install Apps

Here are some the programs I always install.

Git Bash For Mac Catalina 10.15

Don't install Node.js through Homebrew. Use nvm (below).

ProgramPurpose
Visual Studio Codetext editor
Google Chromeweb browser
Firefoxweb browser
Rectanglewindow resizing
iTerm2terminal
Dockerdevelopment
VLC Media Playermedia player
Slackcommunication
Spotifymusic
Postgresdatabase
Posticodatabase UI
PostmanAPI tool

Shell

Catalina comes with zsh as the default shell. Install Oh My Zsh for sensible defaults.

Node.js

Use Node Version Manager (nvm) to install Node.js. This allows you to easily switch between Node versions, which is essential.

Install

Git Bash For Mac Catalina Island

Install the latest version.

Restart terminal and run the final command.

Confirm that you are using the latest version of Node and npm.

Update

For later, here's how to update nvm.

Change version

Here's how to switch to another version and use it.

And to set the default:

Git

Mac

The first thing you should do with Git is set your global configuration.

Input your config and create some aliases.

With the above aliases, I can run git s instead of git status, for example. The less I have to type, the happier I am.

SSH

Simplify the process of SSHing into other boxes. Create an SSH config file.

Add the following contents, changing the variables for any hosts that you connect to. Using the below will be the same as running ssh -i ~/.ssh/key.pem user@example.com.

.ssh/config

Now just run the alias to connect.

Generate SSH key

You can generate an SSH key to distribute.

Add key.

Settings

Git Bash For Mac Catalina Patcher

I don't like a lot of the Apple defaults so here are the things I always change.

To get the Home folder in the finder, press CMD + SHIFT + H and drag the home folder to the sidebar.

General

Git Bash For Mac Catalina Os

  • Set Dark mode
  • Make Google Chrome default browser

Dock

  • Automatically hide and show Dock
  • Show indicators for open applications

Keyboard

  • Key Repeat -> Fast
  • Delay Until Repeat -> Short
  • Disable 'Correct spelling automatically'
  • Disable 'Capitalize words automatically'
  • Disable 'Add period with double-space'
  • Disable 'Use smart quotes and dashes'

Security and Privacy

  • Allow apps downloaded from App Store and identified developers
  • Turn FileVault On (makes sure SSD is securely encrypted)
  • Turn Firewall On (extra security measure)

Sharing

  • Change computer name
  • Make sure all file sharing is disabled

Users & Groups

  • Add 'Rectangle' to Login items
Catalina

Defaults

A few more commands to change some defaults.

Application Settings

Chrome

  • Turn off 'Warn before quitting'
  • Install uBlock Origin
  • Install React DevTools
  • Install Redux DevTools
  • Install JSONView
  • Install DevTools Theme - New Moon
  • Settings

    • Set theme to 'Dark'
    • Go to chrome://flags and set Developer Tools Experiments to 'Enabled'
    • Go to Experiments and select 'Allow custom UI themes'

Visual Studio Code

  • Press CMD + SHIFT + P and click 'Install code command in PATH'.
  • Install Prettier
  • Install New Moon Theme
  • Install GitLens
  • Install Highlight Matching Tag
  • Install ESLint
  • Install Prettier
  • Keyboard Shortcuts

    • Copy Line Down - CMD + SHIFT + E
    • Delete Line - CMD + SHIFT + D
    • Reload Window - Remove Development Mode from When
    • Format Document - CMD + SHIFT + L

Rectangle

  • Full Screen: CMD + SHIFT + ' (prevents messing with other commands)
  • Left Half: CMD + OPTION + LEFT
  • Right Half: CMD + OPTION + RIGHT

iTerm2

  • Set tab to open in same location

Conclusion

That sums it up for my current preferences on setting up a MacBook Pro. I hope it helped speed up your process or gave you ideas for the next time you're setting one up.