目前开发使用的流行操作系统:Windows、MacOS。不管是哪一个系统,都要熟悉它的操作方法、常用快捷键即部分计算机常识(如配置电脑、组装电脑、常见问题修复)。
推荐使用MacOS,没有理由,用过的都会喜欢MacOS。
太多了,后续补充
只说配置项,不根据系统不同讲解具体如何配置
配置用户名和邮箱
git config --global user.name "你的姓名"
git config --global user.email "你的公司邮箱或个人邮箱"
# 检查
# 查看所有全局配置项
git config --global --list
# 查看所有(全局+本地)配置项
git config --list
PS: 邮箱最好与你的代码托管平台(GitHub, GitLab, Gitee)的注册邮箱一致,这样平台才能正确关联你的提交
SSH 公钥:
# 生成SSH公钥
ssh-keygen -t ed25519 -C "备注信息"
# 输出如下 中间通过三次回车键确定
Generating public/private ed25519 key pair.
Enter file in which to save the key (/home/git/.ssh/id_ed25519):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/git/.ssh/id_ed25519
Your public key has been saved in /home/git/.ssh/id_ed25519.pub
The key fingerprint is:
SHA256:ohDd0OK5WG2dx4gST/j35HjvlJlGHvihyY+Msl6IC8I Gitee SSH Key
The key's randomart image is:
+--[ED25519 256]--+
| .o |
| .+oo |
| ...O.o + |
| .= * = +. |
| .o +..S*. + |
|. ...o o..+* * |
|.E. o . ..+.O |
| . . ... o =. |
| ..oo. o.o |
+----[SHA256]-----+
# 查看生成的 SSH 公钥和私钥:
ls ~/.ssh/
# 读取公钥文件 ~/.ssh/id_ed25519.pub:
cat ~/.ssh/id_ed25519.pub
读取到公钥,将字符复制粘贴到对应git平台(如:github、gitee)等,配置好本机就可以有权限拉取代码了。
使用 nvm(Node 版本管理器)
Windows: https://github.com/coreybutler/nvm-windows
Mac/Linux: https://github.com/nvm-sh/nvm
Windows/Mac 安装后验证
node --version
npm --version
# 安装 yarn (我个人喜欢,当然最优秀的肯定是pnpm)
npm install global yarn
yarn --version