Skip to content

Instantly share code, notes, and snippets.

@tzachbon
Last active August 14, 2022 13:39
Show Gist options
  • Save tzachbon/1cdcfec0ff20796bd88e4c95bbed9031 to your computer and use it in GitHub Desktop.
Save tzachbon/1cdcfec0ff20796bd88e4c95bbed9031 to your computer and use it in GitHub Desktop.
Javascript Developer Setup for Mac

Javascript Developer Setup for Mac

This guide is for those who want to prepare their Mac for javascript developement, I attached here some apps that will surely help you and recommendations that are sure to make your life easier.

Specially thanks to my colleagues at wix.com for bring up most of those ideas

TOC

Mandatory

description command
Xcode command-line tools xcode-select --install
brew - mac missing package manager /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
Warp is the best replacement for macOS built-in Terminal brew install --cask warp
Install zshell - A better shell brew install zsh
Install oh-my-zsh - A framework for managing your zsh configuration sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
Upgrade to latest git brew install git
Firefox brew install firefox --cask
VSCode - A lightweight code editor brew install visual-studio-code --cask
fnm - helps you easily switch between multiple node versions curl -fsSL https://fnm.vercel.app/install | bash
Latest LTS version of Node fnm install lts/fermium
Watchman for watching files using Jest test runner brew install watchman
GnuPG - Signing up commits for GitHub brew install gnupg
Slack brew install slack --cask

Recommended

git config

git will present the following warning if a pull.rebase strategy isn't specified:

warning: Pulling without specifying how to reconcile divergent branches is
discouraged. You can squelch this message by running one of the following
commands sometime before your next pull:

  git config pull.rebase false  # merge (the default strategy)
  git config pull.rebase true   # rebase
  git config pull.ff only       # fast-forward only

We recommend running:

git config --global pull.ff only       # fast-forward only
git config --global pull.rebase true   # always try to rebase on pull

git will present the following warning on your first git push provided that you forgot to set an upstream

🤷‍♀️ Confused?! You're not alone with that feeling. Check out this StackOverflow Answer

fatal: The current branch <BRANCH_NAME> has no upstream branch.
To push the current branch and set the remote as upstream, use

    git push --set-upstream origin <BRANCH_NAME>

Set your git to use current branch by default running (no more annoying upstream message):

git config --global push.default current

Git is not case-sensitive by default, which causes problems when trying to rename files without git mv, configure it so it won't happen to you:

git config --global core.ignorecase false

Common git aliases

git config --global alias.co checkout
git config --global alias.br branch
git config --global alias.ci commit
git config --global alias.st status

And a nice final touch, you can make git to autocorrect your aliases with this command:

git config --global help.autocorrect 20

Accounts

  • GitHub - Create an account in GitHub if you don't have one and include your Full name, email and Profile image in account settings

    • Add ssh keys in GitHub as described here
    • Add GPG key in GitHub as described here
    • Config your user name and email with the follow lines:
      git config --global user.name "YOUR-USER-NAME"
      git config --global user.email "YOUR-EMAIL"
    • Sign your commits using this guide - Signing commits

Optional

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment