新员工入职的准备工作——仅此一篇就够了(全流程 超详细 持续更新)——Cursor TARe nvm版本切换 npm源 ssh配置 host文件修改 常用命令等

本文总结了如何快速配置工作环境,包括安装NVM管理Node.js版本,设置npm源,配置Git,管理Git仓库,创建SSH密钥,以及使用VSCode和相关插件。还提供了拉取项目、提交代码的步骤,帮助新入职者迅速适应公司项目。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

根据自己的工作经验总结的,帮助大家入职后快速搭建开发环境,快速上手公司项目

先问清楚接手项目需要的node和npm版本,npm内部源地址等

  • 下载NVM node版本管理工具。方便切换不同的node版本。
    NVM安装教程
    建议直接安装nvm 方便后期多项目切换node版本

  • 下载node默认安装

    • 根据公司需求设置npm源
      配置npm服务器以下载依赖 npm config set registry +链接(淘宝链接:https://registry.npmmirror.com)
      配置好后试用npm config get registry命令查看是否配置正确
      删除当前源 会自动切换为官方源 npm config rm registry
  • 下载GIT 镜像网站

    • global变量配置:git config --global user.name “xxx” git config --global user.email “xxx@xxx.com”
    • global变量查看: git config --global user.name git config --global user.email
    • git remote -v 查看当前绑定的git仓库地址
    • git remote remove <name/origin> 删除当前绑定的git仓库地址
    • git remote add origin … 新增绑定的git仓库地址
    • git remote set-url origin <giturl> git remote add origin <giturl >设置代码提交的目标仓库
    • 开通gitlab仓库权限后设置ssh密钥:是为了节省输入用户名密码的过程,同时保证传输安全
      ssh-keygen -t rsa -C "youremail@example.com" 三次回车 复制里面的SSH密匙 登录GitLab,cat ~/.ssh/id_rsa.pub密钥粘贴到GitLab中,添加ssh,如何添加具体流程:教程
  • 修改host文件
    若访问慢:修改host文件(用绕过dns解析,在本地直接绑定host) 在本地host文件中添加映射:路径是在 C:\Windows\System32\drivers\etc
    Host作用文件理解

  • 翻译软件

    • 设置->取词划词 -> 划词设置 展示方式 双击ctrl展示
    • 设置截屏翻译。都很好用。
  • snipaste 前端设计稿取色 动态截图等。很好用强烈推介。

  • chrome浏览器,开发必备

  • Envato market 是一个代码交易网站,有各种模板供你选择。设计很棒可以参考

  • 下载编辑器:

    • Cursor 是 AI 时代的新型编辑器,因深度集成 GPT-4 迅速走红,降低编码门槛、提升效率,适合快速原型开发和学习。

    • TRAe 我承认Cursor很强,但是TRAe免费呀!还是字节跳动自研的国内IDE!

    • vscode

    • 插件:Vue - Official、chinese、 GitLens、vuter 、Codeium

  • 谷歌插件推介
    沉浸式翻译 查外网文档很好用 比全屏翻译和谷歌页面翻译好用多了哈哈
    在这里插入图片描述

Iconify IntelliSense - Iconify 图标插件
windicss IntelliSense - windicss 提示插件
I18n-ally - i18n 插件
Vetur - vue 开发必备 (也可以选择 Volar)
ESLint - 脚本代码检查
Prettier - 代码格式化
Stylelint - css 格式化
DotENV - .env 文件 高亮
Codeium - AI编码 自动生成注释  一件编码等  完全免费极力推介!
JavaScript and TypeScript Nightly - Vscode编辑器的TS语言支持 解决各种配置以外的报错问题
  • Vscode代码片段,一键生成任何常用代码,又好用又帅!
    案例:
    配置好后输出 html再按tab即可瞬间输出body内部的代码片段

在这里插入图片描述
在这里插入图片描述

{
	// Place your 全局 snippets here. Each snippet is defined under a snippet name and has a scope, prefix, body and 
	// description. Add comma separated ids of the languages where the snippet is applicable in the scope field. If scope 
	// is left empty or omitted, the snippet gets applied to all languages. The prefix is what is 
	// used to trigger the snippet and the body will be expanded and inserted. Possible variables are: 
	// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. 
	// Placeholders with the same ids are connected.
	// Example:
	"Print to console": {
		"prefix": "html",
		"body": [
			"<!DOCTYPE html>",
			"<html lang=\"en\">",
			"<head>",
			"   <meta charset=\"UTF-8\">",
			"   <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">",
			"   <title>Document</title>",
			"</head>",
			"<body>",
			"",
			"</body>",
			"</html>",
		],
		"description": "Log output to console"
	}
}

拉项目:

建文件夹 命令行该目录下(右键powershell/VSCode打开文件夹)
git init git clone (SSH地址)
code .用VSdode打开
npm init 生成 package.json
npm install 更新安装包

提交代码:

git add .
git commit -m""
git pull origin 分支名
git push origin 分支名
git branch
git checkout 分支名
git checkout -b
git merge 分支名
git branch -r 列出所有远程分支
git fetch --all 同步远程仓库的所有分支到本地
git remote -v 查看当前远端地址

执行完 commit 之后,想撤回 commit 不撤销git add .: git reset --soft HEAD^
HEAD^ 意思是上一个版本,也可以写成 HEAD~1
如果进行了 2 次 commit,都想撤回,可以使用 HEAD~2

创建新项目

1.git init
2.git commit -m “first commit”
3.git remote add origin https://github.com/BeatingWorldline/First.git
或git remote add origin git@github.com:BeatingWorldline/First.git
4.git push -u origin master

  # github 
  151.101.72.133 assets-cdn.github.com
  151.101.229.194 github.global.ssl.fastly.net
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

跳动的世界线

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值