Automate Your Development Environment Setup with Scripts and Dotfiles
Based on Corey Schafer's video on YouTube. If you like this content, support the original creators by watching, liking and subscribing to their content.
Start with a clean machine rather than migrating backups to avoid accumulating years of leftover software and settings.
Briefing
A repeatable, from-scratch setup for a new development Mac is built by combining a GitHub “dotfiles” repository with install scripts that automate terminal configuration, package installation, editor settings, and a few OS-level tweaks. The payoff is consistency: every fresh machine ends up matching the same workflow without relying on memory or manual reconfiguration—while still letting the user customize the scripts to their own preferences.
Instead of migrating an existing system (and inheriting years of clutter), the workflow starts with a clean install and then pulls down personalized dotfiles from GitHub. The repository is treated as a living configuration: it includes an install.sh entry point plus modular scripts for macOS-specific changes, Homebrew package installs, and editor setup. A key warning sits at the top of the documentation: running these scripts is highly personalized and can modify system settings in ways that may be irreversible. The recommended approach is to fork the repository, inspect what each script does, and then run the forked version on a machine that matches the user’s needs.
The automation begins by cloning the dotfiles repo into the home directory and then running install.sh, which creates symlinks for shell configuration files such as bash profile and zsh prompt/alias setups. The terminal experience is customized through shared prompt code that works across shells, including a prompt that shows Git branch context and indicators for Python virtual environments. After the shell layer is in place, the scripts move into macOS-specific tasks—installing command-line tools, adjusting input behavior (like mouse scroll direction), and setting the desktop icon.
Homebrew is installed and then used as the backbone for command-line tools and GUI apps. The brew.sh script updates and upgrades packages, installs developer tooling (including Python, Bash/Zsh-related components, Git, and other utilities), and switches the default zsh to the Homebrew-provided version. It also configures Git identity (username and email) during the one-time setup. For GUI applications, Homebrew Cask installs a curated list including Google Chrome, Firefox, Sublime Text, Visual Studio Code, Spotify, Discord, and Google Drive, along with preferred fonts.
Editor configuration is handled next. The Visual Studio Code portion installs extensions and copies over custom settings and keybindings, with a safeguard that backs up existing files before overwriting. Sublime Text requires a different flow: the script opens Sublime Text so its package directories exist, then uses package control settings to install packages and applies custom settings from the repository. The process includes manual prompts for permissions and sign-ins (Chrome first, with other services optionally skipped during the demonstration).
Finally, the setup verifies itself: the terminal prompt reflects Git branch status, and Homebrew lists installed formulas and casks. The overall message is practical—automated dotfiles reduce the chance of forgetting an app, extension, or login, and make new-machine provisioning fast enough to be routine. The scripts are maintained so additions (new Brew packages or Cask apps) can be appended to the lists, keeping the environment aligned over time.
Cornell Notes
The core idea is to provision a new development machine from a clean macOS install by cloning a personalized GitHub dotfiles repository and running an install.sh script. The scripts automate symlinking shell configuration (bash/zsh prompts, aliases, Git-aware prompt behavior), installing Homebrew and packages (command-line tools plus GUI apps via Cask), and applying editor settings for Visual Studio Code and Sublime Text. OS-level tweaks like desktop icon changes and input behavior are included as well, with permission prompts handled during setup. Because the scripts can change system settings and may be hard to undo, the recommended path is to fork the repo, review what each script does, and then run the forked version on your own machine.
Why does the workflow prefer a fresh install over migrating an old Mac setup?
What makes the dotfiles approach “repeatable” instead of just another checklist?
What’s the most important safety caveat before running these scripts?
How does the setup customize the terminal experience?
How are software installations handled across command-line tools and GUI apps?
Why does Sublime Text require a different automation flow than Visual Studio Code?
Review Questions
- What specific components of a development environment does the install.sh script automate, and how do those components interact (shell, packages, editors, OS settings)?
- What risks come with running personalized dotfiles scripts, and what mitigation steps are recommended?
- How does the workflow verify that the environment was configured correctly after installation?
Key Points
- 1
Start with a clean machine rather than migrating backups to avoid accumulating years of leftover software and settings.
- 2
Clone a personalized dotfiles GitHub repository and run install.sh as the single entry point for a full environment rebuild.
- 3
Treat the scripts as system-modifying automation: review them first, then fork the repo for your own machine to avoid overwriting your preferences unexpectedly.
- 4
Use symlink-based shell configuration to standardize bash/zsh prompts, aliases, and Git-aware terminal behavior across machines.
- 5
Rely on Homebrew plus Homebrew Cask to install both command-line tools and GUI apps in a consistent, scripted way.
- 6
Automate editor setup by copying Visual Studio Code settings/extensions and by using Sublime Text’s package control flow that requires opening Sublime at least once.
- 7
Expect and handle one-time permission prompts and sign-in steps during setup so the machine is fully usable when the scripts finish.