Install the Brew

What is Homebrew?

In short, it is a Package manager for macOS (or Linux), which you can use to install the software you need, easy to uninstall and upgrade.

How do I install Homebrew?

The first method

Copy the command shown in the following figure from the official website and enter the command in terminal:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Copy the code

When you type in the command and press enter, we’ll notice that the download is slow, so you just have to wait until it times out.

You keep typing the command to download, and you keep getting errors, unless you add an agent to it, and at some point it suddenly downloads.

Yeah, it’s this one down here

The second way

  1. Search in your browserhttps://raw.githubusercontent.com/Homebrew/install/master/install.sh, and then find the content in Response in Network and copy it down.
  2. Create a new one on the terminalinstall.shFile, enter in the terminaltouch install.sh.
  3. Edit the file,vim install.sh, paste the copy into the document, and then:wqSave and exit.
  4. Finally, run the file,sh install.shWait for brew to be installed!

Third way

You can use another automatic script (all domestic addresses), press Enter, and follow the prompts: Enter the mirror number –> enter Y, press Enter and wait for the BREW installation to complete.

/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"
Copy the code

Install Item2 + Oh my ZSH

You can go directly to the website (Iterm2.com/downloads.h…Download)

Alternatively, brew Cask Install Iterm2 is installed at the terminal, and after the installation is complete you can start installing various plug-ins to optimize, such as Oh my ZSH

Sh -c "$(curl - fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh) or" sh -c "$(wget https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh -O -)"Copy the code

But both of these methods have a problem, is to climb over the wall, or is in the collapse of the edge of crazy testing. Let’s just do the same thing we did with Homebrew, and take your time.

Set please refer to this article zhuanlan.zhihu.com/p/112383265…

Install Nvm + Nodejs

  • nvm: NodeJS versioning tool, a single NVM can manage many node versions.
  • nodejs: The code base required during project development.
  • npm: Nodejs package management tool. When nodeJS is installed, NPM is installed along with it, which is a package management tool.

Install the NVM

The curl - o - https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | bash or wget -- qO https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | bashCopy the code

After the installation is complete, close the terminal, open the terminal again, enter NVM to verify whether the installation is successful, enter NVM -v, if the version number is displayed, the installation is successful. If command not found: NVM is present, add the code fragment from the installation section to the configuration file ~/.bash_profile

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"  # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"  # This loads nvm bash_completion
Copy the code

Note: If oh my ZSH is already installed, you need to add the above configuration information in the.zshrc file.

Install Nodejs

NVM install 6.14.4 NVM install 6.14.4 NVM install 6.14.4 NVM install 6.14.4 NVM install 6.14.4 NVM install 6.14.4 NVM install 6.14.4 NVM install 6.14.4 NVM use nodeCopy the code

Install Git

The first installation method

Install Homebrew, then install Git through Homebrew.

brew install git
Copy the code

The second method of installation

Xcode is integrated with Git, but it’s not installed by default. You’ll need to run Xcode, go to “Xcode” -> “Preferences” and go to “Downloads” in the pop-up window. Select Command Line Tools and click Install to complete the installation.

Create a SSH key

Set username and email (Github keeps track of them every time you commit)

git config --global user.name "your name"
git config --global user.email "your email"
Copy the code

Create an SSH key using terminal commands

ssh-keygen -t rsa -C "your email"
Copy the code

Just press enter. You don’t need to set a password, otherwise you’ll need to enter a password every time you do something. Run the cat command to view and copy the key.

cat .ssh/id_rsa.pub
Copy the code

Open your project management link, find the SSH key and add the resulting key. Save.

The resources

  • brew.sh/
  • github.com/nvm-sh/nvm
  • nodejs.org/en/
  • www.liaoxuefeng.com/wiki/896043…