Git 篇
推送本地项目至线上仓库
plan A
cd deom
git init
git remote add origin https://gitee.com/demo.git // 你的仓库地址
git add .
git commit -m '备注信息'
git push -u origin master -f // 强制提交
Git 忽略提交的文件
plan A
在根目录下新建.gitignore 文件。
/file/ 忽略文件夹
*.exe 忽略某种类型的文件
/file/fileName.js 忽略指定的文件
删除 Git 配置文件
cd filename
find . -name ".git" | xargs rm -Rf 删除所有.git文件
Error 列表
git pull error
git pull origin master --allow-unrelated-histories
// 设置了默认分支
git pull --allow-unrelated-histories
Git 常用命令
// 查看所有分支
git branch -a
// 查看当前分支
git branch
// 切换分支
git checkout devloop
// 创建分支
git branch -M <branch_name>
Github 番外篇
Github Error
git push
// git push 出错时
`SSL_ERROR_SYSCALL in connection to github.com:443`
解决方案
git config --global --unset http.proxy
// 是因为协议的问题
Mac 番外番
权限
`git 切换分支后,保存修改内容,提示没有权限`可能是.git文件权限问题
解决方案
sudo chmod -R 777 .git
git pull
持续更新.....