随笔分类 -  Git

git操作
摘要:转自:https://www.cnblogs.com/mafeng/p/10173919.html 假如我们现在在dev分支上,刚开发完项目,执行了下列命令 git add .git commit -m ‘dev'git push -u origin dev然后我们要把dev分支的代码合并到mast 阅读全文
posted @ 2020-02-15 19:18 maycpou 阅读(2035) 评论(0) 推荐(0)
摘要:一、生成.gitignore文件 1、进入项目根目录,打开终端; 2、输入 vi .gitignore 创建并打开隐藏文件.gitignore; 二 、 设置要忽略上传的文件或文件夹 1、过滤整个文件夹(test文件夹) 命令:test/ 2、过滤具体文件 命令:index.html 3、过滤指定后 阅读全文
posted @ 2019-12-22 20:12 maycpou 阅读(4025) 评论(0) 推荐(0)
摘要:1.git 创建和删除分支: 创建:git branch 分支名字 本地删除:git branch -D 分支名字 远程删除:git push origin :分支名字 2.git 回退到以前提交的版本 git log:查看提交的日志 git reset --hard commit_id(这个是提交 阅读全文
posted @ 2019-11-26 11:42 maycpou 阅读(2048) 评论(0) 推荐(0)
摘要:git报错:Please commit your changes or stash them before you merge. 解决:1.不需要保留本地修改的话,直接将有冲突的文件还原再pull:git checkout [文件路径] 2.需要保留本地修改: (1)git stash,这样本地的所 阅读全文
posted @ 2019-10-23 14:09 maycpou 阅读(4218) 评论(0) 推荐(0)
摘要:Git删除分支 2019.03.18 10:34:07字数 31阅读 671 Git删除远程分支 git push origin --delete <分支名> Git删除本地分支 git branch -d <分支名> 阅读全文
posted @ 2019-10-14 20:50 maycpou 阅读(173) 评论(0) 推荐(0)
摘要:git reset --soft HEAD~1 撤回最近一次的commit(撤销commit,不撤销git add) git reset --mixed HEAD~1 撤回最近一次的commit(撤销commit,撤销git add) git reset --hard HEAD~1 撤回最近一次的c 阅读全文
posted @ 2019-09-11 16:06 maycpou 阅读(9380) 评论(0) 推荐(1)
摘要:git status 先看一下add 中的文件 git reset HEAD 如果后面什么都不跟的话 就是上一次add 里面的全部撤销了 git reset HEAD XXX/XXX/XXX.java 就是对某个文件进行撤销了 阅读全文
posted @ 2019-09-10 15:56 maycpou 阅读(181) 评论(0) 推荐(0)
摘要:原因:上传的文件过大,这里我上传的文件有10G+所以报了上面的错误 解决方法:依次运行:git config --global pack.threads 1 git,git config --global pack.deltaCacheSize 128m,git config --global pa 阅读全文
posted @ 2019-08-29 16:57 maycpou 阅读(8812) 评论(2) 推荐(0)