GIT仓库的创建于错误解决

80 阅读2分钟

持续创作,加速成长!这是我参与「掘金日新计划 · 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. 完成

报错解决方案

  1. OpenSSL SSL_read: Connection was reset, errno 10054
  • git config --global http.sslVerify "false"

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

  1. 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*