持续创作,加速成长!这是我参与「掘金日新计划 · 10 月更文挑战」的第10天
总结:
Git的相关命令
| 命令 | 解析 |
|---|---|
| git init 初始化项目 | 默认分支(master) |
| vim 文件夹名称 | 创建文件夹 |
| cat 文件夹名称 | 查看内容 |
| git add . | 添加暂存区 |
| git status 查看此时目录下的状态 | 绿色代表在暂存区,红色代表在工作区 |
| git rm --cached 文件夹名称 | 移除暂存区的内容 |
| git commit -m "注释" | 把暂存区的内容放入到历史区 |
| git log | 查看提交的记录 |
| git reset --hard 版本号 | 切换回指定的版本 |
| git revert HEAD | 撤销 |
| git branch | 查看分支 |
| git branch 分支名称 | 创建分支 |
| git checkout 准备切换到的分支名称 | 切换分支 |
| git merge 需要合并的分支名称 | 合并分支 |
| git branch -d 删除分支名称 | 删除分支 |
| git remote add 别名 仓库地址 | 将本地跟远端服务器连接 |
| git remote -v | 查看是否连接上远端的地址 |
| git remote remove origin | 删除与远端服务器连接 |
| git pull | 把远程仓库修改过的数据增加到本地 |
| git clone GitHub地址 | 从远程仓库克隆到本地 |
1. 创建仓库

2. 初始化仓库
- 在所需要创建 git 的命令下, 右键打开 git bash

3. 连接远程服务器

- git remote add 别名 仓库地址

4. 推送到远程端
- git push -u origin "分支名称"

5. 完成

报错解决方案
- OpenSSL SSL_read: Connection was reset, errno 10054
- git config --global http.sslVerify "false"

- Failed to connect to github.com port 443: Timed out
- git config --global --unset http.proxy
- git config --global --unset https.proxy

- git报错fatal: unable to access ‘github.com/.......‘: OpenSSL SSL_read: Connection was reset
- git config --global http.sslVerify "false" (解除ssl验证后,再次git即可)

dependencies
#开头的便是注释
忽略文件和目录
/node_modules /.pnp .pnp.js
testing
/coverage
production
/build
misc
.DS_Store .env.local .env.development.local .env.test.local .env.production.local
使用通配符
npm-debug.log* yarn-debug.log* yarn-error.log*