git 的使用和问题解决

一、基础配置
1.1 进行基础配置,作为 git 的基础配置,作用是告诉 git 你是谁,你输入的信息将出现在你创建的提交中,使用下面两条命令:

git config –global user.name "qiyu.zhang"   
git config –global user.email qiyu.zhang@epichust.com

1.2  在放置项目文件夹中执行下面命令,完成初始化:

  git init

1.3 如果想克隆,只需要执行如下命令:

  git clone < 项目地址 >

二、报错问题解决

(1)npm ERR! code ERESOLVE 解决方法

截图.png
** 解决方法:
**
在命令后面加上 –legacy-peer-deps

(2)npm WARN config global --global, --local are deprecated. Use --location=global instead.
解决方法:
截图.png

(3)npm ERR A complete log of this run can be found in npm ERR

解决方案:

  1. 删除本地 node_modules 依赖包

2. 升级 npm npm i npm -g

3. 执行 npm cache clean –force 清理缓存

4.npm install

或者安装 nvm 控制 node 版本